Solved

SQL slow?

Posted on 1998-07-21
5
229 Views
Last Modified: 2013-11-20

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,
0
Comment
Question by:gorgar
  • 3
5 Comments
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 250 total points
Comment Utility
Make sure that your database has an index for the Artist column.
0
 

Author Comment

by:gorgar
Comment Utility

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,

0
 

Author Comment

by:gorgar
Comment Utility
Adjusted points to 150
0
 

Author Comment

by:gorgar
Comment Utility
Adjusted points to 250
0
 
LVL 1

Expert Comment

by:slinky
Comment Utility
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?
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
if loop error 4 76
sameEnds challenge 3 105
matchUp  challenge 9 71
sumHeights  challenge 17 59
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video discusses moving either the default database or any database to a new volume.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now