Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Andy Kramek
  Where is Andy Kramek?
 Hot Springs Village
 Arkansas - United States
 Andy Kramek
 To: Kent Jensen
  Where is Kent Jensen?
 Las Pinas
 Philippines
 Kent Jensen
 Tags
Subject: RE: Data Environment
Thread ID: 47725 Message ID: 79660 # Views: 2 # Ratings: 0
Version: Visual FoxPro 6 Category: Forms
Date: Thursday, October 20, 2005 1:28:07 PM         
   


Hi Kent

> i have a problem in filtering a specific record in a table it takes me about 20 seconds to filter my option. below is my example
>
> i have a form that uses about 10 tables, 1 table contains about 300,500.00 records in these 300,500.00 records i only need to retrieve records that contain a "T" value in a field, can you give me some advice/pointers how to make my form filter these records much more faster.
>
> is there any standard code or step by step precedures in accessing tables faster.


First ensure that there is an index on the field in question and that the key value for the index exactly matches the way in which the filter is defined. So if you use a filter "UPPER( xxxx ) == 'T'" then you must build the index using "INDEX ON UPPER( xxxx )" also. If you don't, Rushmore cannot use the index.

Don't use negative expressions ("NOT xxxx = 'T'") , or filtered indexes (INDEX ON xxxx TAG yyy FOR xxxx = "T") or functions (like EMPTY()) these are not optimizable either.

It may even be quicker to use a view, or cursor, than a filter, but that will depend on what you are doing and I can't say for certain, but generally SQL is faster than using a filter - especially if you are displaying the results in a grid because, (before VFP 9.0) grids are not optimizable either.

Regards
Andy Kramek
Microsoft MVP (Visual FoxPro)
Tightline Computers Inc, Akron Ohio, USA

ENTIRE THREAD

Data Environment Posted by Tom Thomas @ 7/27/2004 11:00:59 AM
RE: Data Environment Posted by Boudewijn Lutgerink @ 7/27/2004 11:45:05 AM
RE: Data Environment Posted by Tom Thomas @ 7/27/2004 12:08:51 PM
RE: Data Environment Posted by Andy Kramek @ 7/27/2004 1:01:11 PM
RE: Data Environment Posted by Tom Thomas @ 7/27/2004 2:35:51 PM
RE: Data Environment Posted by Andy Kramek @ 7/27/2004 3:51:56 PM
RE: Data Environment Posted by Kent Jensen @ 10/20/2005 8:00:55 AM
RE: Data Environment Posted by Andy Kramek @ 10/20/2005 1:28:07 PM
RE: Data Environment Posted by Kent Jensen @ 11/2/2005 5:56:47 AM
RE: Data Environment Posted by Boudewijn Lutgerink @ 11/2/2005 7:18:44 AM
RE: Data Environment Posted by Victor @ 11/2/2005 4:22:03 PM
RE: Data Environment Posted by Ken Murphy @ 11/2/2005 6:03:11 PM
RE: Data Environment Posted by Kent Jensen @ 11/4/2005 4:00:02 AM
RE: Data Environment Posted by Boudewijn Lutgerink @ 11/4/2005 6:07:02 AM
RE: Data Environment Posted by Kent Jensen @ 11/4/2005 4:03:13 AM
RE: Data Environment Posted by Ken Murphy @ 10/20/2005 3:28:45 PM
RE: Data Environment Posted by Jerzy Kopinski @ 10/20/2005 9:14:50 AM
RE: Data Environment Posted by Terry Bottorff @ 10/21/2005 5:55:03 PM
RE: Data Environment Posted by Jerzy Kopinski @ 10/24/2005 7:25:36 AM