Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Optimizing speed of SQL Select
Message
From
07/10/2005 12:31:52
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 6 SP5
Miscellaneous
Thread ID:
01057215
Message ID:
01057248
Views:
7
>I am trying to improve a speed of a SQL query. Currently the query looks like this:
>
>
>select MYFIELD from MYTABLE where MYFIELD1 = "00"
>
>
>Note that the table has index tag on field MYFIELD1.
>The customer says that working against a table of about 150,000 record this takes up to 5 minutes.
>
>I want to add two more conditions to the query, both on fields that have index tags. Therefore the query will look like following:
>
>
>select MYFIELD from MYTABLE where MYFIELD1 = "00" and MYFIELD2 = "O"
>and MYFIELD3 = "C"
>
>
>I know that the table has much fewer records on the MYFIELD2 = "O" and then within those there are some small number where MYFIEL3 = "C", and then within those there are some that have MYFIELD1 = "00".
>
>My question is, does it matter in which order I will put the WHERE expression in the above SQL Select?
>
>Thank you.

Dmitry,
PMFJI but even with no indexes, nothing for optimization etc 5mins sounds too much for 150K records. Sounds like there is a problem in table header to me. Can you create a fresh copy of that table and try (with or w/o indexes, shared or exclusive).
Networked? Faulty HW?
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform