Solved

SQL slow?

Posted on 1998-07-21
5
265 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 15

Accepted Solution

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

Author Comment

by:gorgar
ID: 1319505

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
ID: 1319506
Adjusted points to 150
0
 

Author Comment

by:gorgar
ID: 1319507
Adjusted points to 250
0
 
LVL 1

Expert Comment

by:slinky
ID: 1319508
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

729 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