JonMny
asked on
query performance
can anyone tell me a better way to do this
I have a table where they have
client l1 l2 l3 l4 l5 l6 up to l50
I need the results like
client l1
client l2
I did with a union but seems slow any thoughts?
I have a table where they have
client l1 l2 l3 l4 l5 l6 up to l50
I need the results like
client l1
client l2
I did with a union but seems slow any thoughts?
I did with a union but seems slow any thoughts?
As suggested previously, if it is too slow consider designing the table correctly.
As suggested previously, if it is too slow consider designing the table correctly.
ASKER
not possible to redesign table. Legacy system.
In your procedure, create a temp table that is designed correctly and pre-determine what goes into that table before you do any querying of the data. This narrows your result set before you start smashing your SQL Server memory with high traffic. With it being a temporary table as well it will re-direct a lot of the processing onto tempdb.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
not possible to redesign table. Legacy system.
Then you are in for a rough ride.
Then you are in for a rough ride.
ASKER
oh I know, the funny part is they want to buy this code....
Of course, setting up the table that way in the first place was a bad idea :)