Solved

SQL slow?

Posted on 1998-07-21
5
261 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
sumDigits challenge 9 172
centeredAverage challenge 8 186
java ^ examples 8 70
Authenticate using sesu from script 7 116
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

733 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