Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
McGurk
Starting Member
21 Posts |
Posted - 2009-10-26 : 12:09:43
|
Simple stored procedure but it is slow. Can I do something to speed it up?SELECT DISTINCT SellerFROM SellersORDER BY Seller McGurkAll that is gold does not glitter, not all those who wander are lost... JRR Tolkien |
|
|
yosiasz
Master Smack Fu Yak Hacker
1635 Posts |
Posted - 2009-10-26 : 12:12:43
|
| how many rows does it have?is Seller indexed?show us the data structure of that tablehighlight Seller and do Alt+F1<><><><><><><><><><><><><><><><><><><><><><><><><>If you don't have the passion to help people, you have no passion |
 |
|
|
McGurk
Starting Member
21 Posts |
Posted - 2009-10-26 : 12:46:17
|
| Thanks for your quick reply!- 50,000 rows (the stored procedure results in over 23,000 records)- Seller is indexed- Data structure? Are you looking for the the table structure or something more? Alt+F1 did not give me anything.Here is the table:SellerID(PK) IntID(FK) varchar(10)Seller(Indexed) varchar(50)Field4 varchar(15)Field5 varchar(10)Field6 varchar(10)Field7 varchar(50)Field8 char(5)Field9 char(10)McGurkAll that is gold does not glitter, not all those who wander are lost... JRR Tolkien |
 |
|
|
Vinnie881
Master Smack Fu Yak Hacker
1231 Posts |
Posted - 2009-10-26 : 14:32:25
|
First rebuild the index to ensure it's properly workingIt's a very simple query, and if it's properly indexed, and it's still running slow, your only options are to get better hardware to run it. There's not too much that can be done in terms of rewriting the query for a dramatic speed increase. Success is 10% Intelligence, 70% Determination, and 22% Stupidity.\_/ _/ _/\_/ _/\_/ _/ _/- 881 |
 |
|
|
mfemenel
Professor Frink
1421 Posts |
Posted - 2009-10-26 : 15:05:17
|
| Why are you using distinct? Do you have duplicate sellers in your table? The DISTINCT keyword is going to cost you a little bit of time.Mike"oh, that monkey is going to pay" |
 |
|
|
|
|
|