Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

SQL slow?

Posted on 1998-07-21
5
Medium Priority
?
279 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 500 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

Industry Leaders: 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

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 …
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

650 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