Hi:

I have a small aplication that runs only with free tables. I have been
hearing that CDX files could get corrupted for a number of reasons,
but the only reason I need the indexes is for some seek commands to
validate certain fields. My tables are actually small mostly on the
range of 500 to 1000 cases.

Is is a good idea to change the seek commands with locate commands in
order to avoid generating indexes, are CDX files necessary on free
tables. should I expect performance problems with this change?

Thanks for your time!!!

Re: Locate vs Seek Command by Dan

Dan
Tue Sep 18 09:34:17 PDT 2007

The only right answer here is "it depends". <g>

If you only need to find a couple of values, LOCATE might serve you just
fine. But there's one mighty big gotcha waiting for you: Rushmore. If LOCATE
thinks it needs an index tag and can't find one, it will pause to create an
in-memory index before doing its thing. If you do that a few hundred
times/day, depending on how much can be kept cached, it could actually work
against you.

If you experience frequent index corruption, investigate the cause of that
because it hints that your data is in danger as well. Indexes do not corrupt
during normal operation. They corrupt during events that interrupt I/O to
the disk -- that I/O could just as easily be your data.

Dan


Texeira wrote:
> Hi:
>
> I have a small aplication that runs only with free tables. I have been
> hearing that CDX files could get corrupted for a number of reasons,
> but the only reason I need the indexes is for some seek commands to
> validate certain fields. My tables are actually small mostly on the
> range of 500 to 1000 cases.
>
> Is is a good idea to change the seek commands with locate commands in
> order to avoid generating indexes, are CDX files necessary on free
> tables. should I expect performance problems with this change?
>
> Thanks for your time!!!



Re: Locate vs Seek Command by MikeA

MikeA
Wed Sep 19 02:06:47 PDT 2007

Dan - what do you mean by "if LOCATE thinks it needs an index tag and can't
find one." When would it "think" it needs one or in other words what
triggers it to think so?

I think your answer about "it depends" is correct. In general one would
probably not need indexes on tables of only 1000 records but to me the "it
depends" would be very much determined by how often the locate is being
performed.

Mike

"Dan Freeman" <spam@microsoft.com> wrote in message
news:%23mcnCHh%23HHA.3400@TK2MSFTNGP03.phx.gbl...
> The only right answer here is "it depends". <g>
>
> If you only need to find a couple of values, LOCATE might serve you just
> fine. But there's one mighty big gotcha waiting for you: Rushmore. If
> LOCATE thinks it needs an index tag and can't find one, it will pause to
> create an in-memory index before doing its thing. If you do that a few
> hundred times/day, depending on how much can be kept cached, it could
> actually work against you.
>
> If you experience frequent index corruption, investigate the cause of that
> because it hints that your data is in danger as well. Indexes do not
> corrupt during normal operation. They corrupt during events that interrupt
> I/O to the disk -- that I/O could just as easily be your data.
>
> Dan
>
>
> Texeira wrote:
>> Hi:
>>
>> I have a small aplication that runs only with free tables. I have been
>> hearing that CDX files could get corrupted for a number of reasons,
>> but the only reason I need the indexes is for some seek commands to
>> validate certain fields. My tables are actually small mostly on the
>> range of 500 to 1000 cases.
>>
>> Is is a good idea to change the seek commands with locate commands in
>> order to avoid generating indexes, are CDX files necessary on free
>> tables. should I expect performance problems with this change?
>>
>> Thanks for your time!!!
>
>



Re: Locate vs Seek Command by Dan

Dan
Wed Sep 19 08:48:23 PDT 2007

MikeA wrote:
> Dan - what do you mean by "if LOCATE thinks it needs an index tag and
> can't find one." When would it "think" it needs one or in other
> words what triggers it to think so?

Available resources, mostly.

> I think your answer about "it depends" is correct. In general one
> would probably not need indexes on tables of only 1000 records but to
> me the "it depends" would be very much determined by how often the
> locate is being performed.

See above.

Dan



Re: Locate vs Seek Command by Man-wai

Man-wai
Thu Sep 20 05:28:54 PDT 2007

> Is is a good idea to change the seek commands with locate commands in
> order to avoid generating indexes, are CDX files necessary on free
> tables. should I expect performance problems with this change?

If the DBF has the right indexes on the fields, LOCATE could be till as
fast as SEEK and remains more flexible.

--
@~@ Might, Courage, Vision, SINCERITY.
/ v \ Simplicity is Beauty! May the Force and Farce be with you!
/( _ )\ (Xubuntu 7.04) Linux 2.6.22.6
^ ^ 20:26:01 up 9 days 10:45 1 user load average: 0.05 0.01 0.00
news://news.3home.net news://news.hkpcug.org news://news.newsgroup.com.hk

Re: Locate vs Seek Command by MikeA

MikeA
Thu Sep 20 09:52:26 PDT 2007

I disagree in that locate is never as fast as seek. I agree that it can be
close but it is never quite as fast. VFP still has the overhead of finding
the right index and optimizing where the search begins. But, I agree that
locate is more flexible. If you create a tight loop and do the same seek
vs. locate on a large table, seek will best locate every time.

Mike


"Man-wai Chang ToDie" <toylet.toylet@gmail.com> wrote in message
news:ejM7mG4%23HHA.4732@TK2MSFTNGP04.phx.gbl...
>> Is is a good idea to change the seek commands with locate commands in
>> order to avoid generating indexes, are CDX files necessary on free
>> tables. should I expect performance problems with this change?
>
> If the DBF has the right indexes on the fields, LOCATE could be till as
> fast as SEEK and remains more flexible.
>
> --
> @~@ Might, Courage, Vision, SINCERITY.
> / v \ Simplicity is Beauty! May the Force and Farce be with you!
> /( _ )\ (Xubuntu 7.04) Linux 2.6.22.6
> ^ ^ 20:26:01 up 9 days 10:45 1 user load average: 0.05 0.01 0.00
> news://news.3home.net news://news.hkpcug.org news://news.newsgroup.com.hk



Re: Locate vs Seek Command by Cy

Cy
Fri Sep 21 21:19:25 PDT 2007

Bzzzzzt!!! Nope, wrong answer. Locate while quite fast if optimized is
still only a fraction of the speed of seeks. I have done routines that do
100s of 1000s of iterative locates/seeks and the seeks are still many many
times faster. If you do a seek or locate 500,000 times you will see a quite
measurable difference in the time with the seeks being much faster.

--
Cy Welch
Senior Programmer/Analyst
MetSYS Inc.
http://www.metsysinc.com

"Man-wai Chang ToDie" <toylet.toylet@gmail.com> wrote in message
news:ejM7mG4#HHA.4732@TK2MSFTNGP04.phx.gbl...
>> Is is a good idea to change the seek commands with locate commands in
>> order to avoid generating indexes, are CDX files necessary on free
>> tables. should I expect performance problems with this change?
>
> If the DBF has the right indexes on the fields, LOCATE could be till as
> fast as SEEK and remains more flexible.
>
> --
> @~@ Might, Courage, Vision, SINCERITY.
> / v \ Simplicity is Beauty! May the Force and Farce be with you!
> /( _ )\ (Xubuntu 7.04) Linux 2.6.22.6
> ^ ^ 20:26:01 up 9 days 10:45 1 user load average: 0.05 0.01 0.00
> news://news.3home.net news://news.hkpcug.org news://news.newsgroup.com.hk


Re: Locate vs Seek Command by Man-wai

Man-wai
Sun Sep 23 23:53:27 PDT 2007

> do 100s of 1000s of iterative locates/seeks and the seeks are still many
> many times faster. If you do a seek or locate 500,000 times you will
> see a quite measurable difference in the time with the seeks being much
> faster.

My opinion was based on Foxpro DOS 2.6. So ... maybe things changed in
VFP. :)

--
@~@ Might, Courage, Vision, SINCERITY.
/ v \ Simplicity is Beauty! May the Force and Farce be with you!
/( _ )\ (Xubuntu 7.04) Linux 2.6.22.7
^ ^ 14:51:01 up 18:06 0 users load average: 0.00 0.00 0.00
news://news.3home.net news://news.hkpcug.org news://news.newsgroup.com.hk

Re: Locate vs Seek Command by Cy

Cy
Mon Sep 24 21:25:12 PDT 2007

I never tried it in 2.6 DOS, but in 2.6 Windows and beyond every time I have
tried it (have a routine that does 100s of 1000s of seeks/locates in a loop)
with a locate rather than a seek it takes many times as long using the
locate. It's gotten better over the years, but locate has never caught up
with seek().

--
Cy Welch
Senior Programmer/Analyst
MetSYS Inc.
http://www.metsysinc.com

"Man-wai Chang ToDie" <toylet.toylet@gmail.com> wrote in message
news:u98Lrdn$HHA.3848@TK2MSFTNGP05.phx.gbl...
>> do 100s of 1000s of iterative locates/seeks and the seeks are still many
>> many times faster. If you do a seek or locate 500,000 times you will see
>> a quite measurable difference in the time with the seeks being much
>> faster.
>
> My opinion was based on Foxpro DOS 2.6. So ... maybe things changed in
> VFP. :)
>
> --
> @~@ Might, Courage, Vision, SINCERITY.
> / v \ Simplicity is Beauty! May the Force and Farce be with you!
> /( _ )\ (Xubuntu 7.04) Linux 2.6.22.7
> ^ ^ 14:51:01 up 18:06 0 users load average: 0.00 0.00 0.00
> news://news.3home.net news://news.hkpcug.org news://news.newsgroup.com.hk