Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Ken Murphy
  Where is Ken Murphy?
 Springhill
 Canada
 Ken Murphy
 To: Kent Jensen
  Where is Kent Jensen?
 Las Pinas
 Philippines
 Kent Jensen
 Tags
Subject: RE: Data Environment
Thread ID: 47725 Message ID: 79666 # Views: 2 # Ratings: 0
Version: Visual FoxPro 6 Category: Forms
Date: Thursday, October 20, 2005 3:28:45 PM         
   


> hi Andy
>
> 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.
>
>
>
> > Hi Tom
> >
> > > The following is a text taken from MSDN on VFP
> > >
> > > Using the Data Environment
> > > If you use the data environment of the Form Designer or Report Designer, table open performance is much faster than executing USE, SET ORDER, and SET RELATION commands in the form Load event. When you use the data environment, Visual FoxPro uses low-level engine calls to open the tables and set up the indexes and relations.
> >
> > > I thought there is some truth in what MS says :-)
> >
> >
> > This is undoutedly true, in theory, but my comment is based on practical experience. In reality the determining factor is the speed with which your network can handle the data. The difference between the USE command and the DE on a local machine for a single table is typically on the order of 0.005 seconds. Even if you were opening a hundred tables this is simply irrelevant whne compared to the time necessary to bring the data over the network.
> >
> >
> > Regards
> > Andy Kramek
> > Microsoft MVP (Visual FoxPro)
> > Akron, OH, USA


Andy is correct - Rushmore will not use a filtered index, but you can. Depending on what you are doing, you may find it faster to create an index (for example, INDEX ON MyKey FOR lMyField TO TAG MyTag) If the result of this is a record set of 50 or so records out of 300,000, it would probably be faster to SET ORDER TO TAG MyTag and then SCAN. I use this method in a financial app where the user needs the 300 or so transaction records (out of 1,000,000) that need to be included in that morning's deposit.

It all depends on what you are trying to accomplish.
Ken

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