gorgar
asked on
SQL slow?
Hi,
I'm developing a database which contains aprox. 3500 records and each record contains the following fields:
ID - int
Artist, Song, Path - CString
I sort database by reopening it with SQL statement like one that follows:
SELECT * FROM Table1 ORDER BY Artist
The problem is - speed! It takes aprox. 20 seconds to complete this job. Could it be (a little) faster?
Regards,
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Adjusted points to 150
ASKER
Adjusted points to 250
You should specify the column names you want to return rather than doing a select *.
Also, don't do an 'order by' that will slow it down as it has to select all the records and then do a sort. If you are adding the names into a listbox then let the listbox do the sorting for you.
Make the artist colum the primary key in the table or set a primary key like artist_no (if you are going to join to other tables).
What ODBC calls are you using?
Also, don't do an 'order by' that will slow it down as it has to select all the records and then do a sort. If you are adding the names into a listbox then let the listbox do the sorting for you.
Make the artist colum the primary key in the table or set a primary key like artist_no (if you are going to join to other tables).
What ODBC calls are you using?
ASKER
In Design View of my database table in Access, General tab for artist field, 'Indexed' is set up to Yes (duplicates OK) .
It obviously doesn't do the job :(
Then, how do i make Artist column indexed?
Regards,