Solved

SQL slow?

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
withoutTen challenge 14 131
fix34  challenge 9 141
How to convert MFC::CString to UTF8 wchar_t* 10 277
Sed question 2 101
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.
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.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

856 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