October 12, 2009 at 10:17 am
I am using a system that gets information from an end-user, and puts the selection into a parameter table (for multiple selections). This seems to cause a table scan, so it slows down the processing of the data tremendously. There can be multiple parameters that are each turned into a parameter table and linked to the main table.
Is there a way to index a parameter table? I can not create a primary key on the parameter table because nulls can be part of the selection criteria. Even if I index the tables, will this speed up the processing?
Any advice is appreciated. Thanks.
October 12, 2009 at 2:13 pm
How many rows can it be returned by the function? Maybe you could store the rows in a temp table and index it?
How the function looks like - can you show the code?
Regards
Piotr
...and your only reply is slàinte mhath
October 12, 2009 at 2:21 pm
You can create indexes on temp tables. But not on the output from a TVF. You might consider outputing the TVF into a temp table or table variable and see if that helps.
Are you using a CROSS APPLY or anything like that?
CEWII
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply