CDX indexes

  • Follow


Hi,
Having spent many years using just NTX indexes. I was starting to have speed 
issues with a busy client so I decided to change to CDX indexes. I have used 
the CDX indexes only on the major files that have multiple indexes and the 
speen incease is significant. This all went well apart from some bizarre 
stuff, for example:
I had 6 records indexed on a numeric field, 1000.00 through to 1000.05
X := 1000
dbseek(x)               // found
x += 0.01
dbseek(x)               // found
x += 0.01
dbseek(x)               // found
x += 0.01
dbseek(x)               // found
x += 0.01
dbseek(x)               // NOT found but why?
dbseek(1000.04)    // found
x += 0.01
dbseek(x)               // NOT found but why?
dbseek(1000.05)    //found
This had been working for many years with the NTX index! I ended up indexing 
on STR(LABNO,9,2) and changing all the seeks and it all worked OK, but why?

My main question is regarding the DBFCDX and SIXCDX drivers. Are CDX indexes 
created by both systems interchangable? I ended up using the SIXCDX driver 
as it seemed to work better (too complicated to explain).

I also need to use xBase++ for some of the serial comms stuff that I do as 
Clipper Tools III does not recognise non-standard (USB and add in card) 
serial ports. How do I use both CDX and NTX indexes in xBase++ programmes? 
What combination of DBELOAD and DBEBUILD to I need to acheive this?

Many Thanks

Ian Boys
DTE Systems Ltd


0
Reply Ian 2/5/2010 10:06:21 AM

Ian,

This is all to do with decimal rounding and precision. Doing a seek on a 
float is always going to be difficult because internally in the DBF (or 
in the variable), the actual value could be 1000.0400000000001 or 
1000.03999999999999 etc. Make sure of your default settings for SET 
DECIMAL and related items.

Geoff



"Ian Boys" <not@given.com> wrote in message 
news:bJKdnf6ufJYBcPbWnZ2dnUVZ8kWdnZ2d@bt.com:

> Hi,
> Having spent many years using just NTX indexes. I was starting to have speed
> issues with a busy client so I decided to change to CDX indexes. I have used
> the CDX indexes only on the major files that have multiple indexes and the
> speen incease is significant. This all went well apart from some bizarre
> stuff, for example:
> I had 6 records indexed on a numeric field, 1000.00 through to 1000.05
> X := 1000
> dbseek(x)               // found
> x += 0.01
> dbseek(x)               // found
> x += 0.01
> dbseek(x)               // found
> x += 0.01
> dbseek(x)               // found
> x += 0.01
> dbseek(x)               // NOT found but why?
> dbseek(1000.04)    // found
> x += 0.01
> dbseek(x)               // NOT found but why?
> dbseek(1000.05)    //found
> This had been working for many years with the NTX index! I ended up indexing
> on STR(LABNO,9,2) and changing all the seeks and it all worked OK, but why?
>
> My main question is regarding the DBFCDX and SIXCDX drivers. Are CDX indexes
> created by both systems interchangable? I ended up using the SIXCDX driver
> as it seemed to work better (too complicated to explain).
>
> I also need to use xBase++ for some of the serial comms stuff that I do as
> Clipper Tools III does not recognise non-standard (USB and add in card)
> serial ports. How do I use both CDX and NTX indexes in xBase++ programmes?
> What combination of DBELOAD and DBEBUILD to I need to acheive this?
>
> Many Thanks
>
> Ian Boys
> DTE Systems Ltd

0
Reply Geoff 2/5/2010 10:41:12 AM


i always use str() indexing numerfields

index on str(field,16,2)

dbseek( str( nseek ,16,2) )

Ian Boys schrieb:
> Hi,
> Having spent many years using just NTX indexes. I was starting to have 
> speed issues with a busy client so I decided to change to CDX indexes. I 
> have used the CDX indexes only on the major files that have multiple 
> indexes and the speen incease is significant. This all went well apart 
> from some bizarre stuff, for example:
> I had 6 records indexed on a numeric field, 1000.00 through to 1000.05
> X := 1000
> dbseek(x)               // found
> x += 0.01
> dbseek(x)               // found
> x += 0.01
> dbseek(x)               // found
> x += 0.01
> dbseek(x)               // found
> x += 0.01
> dbseek(x)               // NOT found but why?
> dbseek(1000.04)    // found
> x += 0.01
> dbseek(x)               // NOT found but why?
> dbseek(1000.05)    //found
> This had been working for many years with the NTX index! I ended up 
> indexing on STR(LABNO,9,2) and changing all the seeks and it all worked 
> OK, but why?
> 
> My main question is regarding the DBFCDX and SIXCDX drivers. Are CDX 
> indexes created by both systems interchangable? I ended up using the 
> SIXCDX driver as it seemed to work better (too complicated to explain).
> 
> I also need to use xBase++ for some of the serial comms stuff that I do 
> as Clipper Tools III does not recognise non-standard (USB and add in 
> card) serial ports. How do I use both CDX and NTX indexes in xBase++ 
> programmes? What combination of DBELOAD and DBEBUILD to I need to 
> acheive this?
> 
> Many Thanks
> 
> Ian Boys
> DTE Systems Ltd
> 
> 
0
Reply Eckhard 2/5/2010 10:42:25 AM

Geoff,

I had kind of figured that but I thought that the set decimal didn't 
actually change the value, just how it was displayed and therefore would not 
help the situation.  It's still strange that it had been working for years 
and only came to light with the index change.

Ian

"Geoff Schaller" <geoffx@softxwareobjectives.com.au> wrote in message 
news:cBSan.5741$pv.2039@news-server.bigpond.net.au...
> Ian,
>
> This is all to do with decimal rounding and precision. Doing a seek on a 
> float is always going to be difficult because internally in the DBF (or in 
> the variable), the actual value could be 1000.0400000000001 or 
> 1000.03999999999999 etc. Make sure of your default settings for SET 
> DECIMAL and related items.
>
> Geoff
>
>
>
> "Ian Boys" <not@given.com> wrote in message 
> news:bJKdnf6ufJYBcPbWnZ2dnUVZ8kWdnZ2d@bt.com:
>
>> Hi,
>> Having spent many years using just NTX indexes. I was starting to have 
>> speed
>> issues with a busy client so I decided to change to CDX indexes. I have 
>> used
>> the CDX indexes only on the major files that have multiple indexes and 
>> the
>> speen incease is significant. This all went well apart from some bizarre
>> stuff, for example:
>> I had 6 records indexed on a numeric field, 1000.00 through to 1000.05
>> X := 1000
>> dbseek(x)               // found
>> x += 0.01
>> dbseek(x)               // found
>> x += 0.01
>> dbseek(x)               // found
>> x += 0.01
>> dbseek(x)               // found
>> x += 0.01
>> dbseek(x)               // NOT found but why?
>> dbseek(1000.04)    // found
>> x += 0.01
>> dbseek(x)               // NOT found but why?
>> dbseek(1000.05)    //found
>> This had been working for many years with the NTX index! I ended up 
>> indexing
>> on STR(LABNO,9,2) and changing all the seeks and it all worked OK, but 
>> why?
>>
>> My main question is regarding the DBFCDX and SIXCDX drivers. Are CDX 
>> indexes
>> created by both systems interchangable? I ended up using the SIXCDX 
>> driver
>> as it seemed to work better (too complicated to explain).
>>
>> I also need to use xBase++ for some of the serial comms stuff that I do 
>> as
>> Clipper Tools III does not recognise non-standard (USB and add in card)
>> serial ports. How do I use both CDX and NTX indexes in xBase++ 
>> programmes?
>> What combination of DBELOAD and DBEBUILD to I need to acheive this?
>>
>> Many Thanks
>>
>> Ian Boys
>> DTE Systems Ltd
> 

0
Reply not2412 (91) 2/5/2010 11:14:57 AM

Dear Ian Boys:

On Feb 5, 4:14=A0am, "Ian Boys" <n...@given.com> wrote:

> I had kind of figured that but I thought
> that the set decimal didn't actually change
> the value, just how it was displayed and
> therefore would not help the situation.
>=A0It's still strange that it had been working
> for years and only came to light with the
> index change.

Not really that odd, since the index RDD could have different logic
for data handling.  And since it was known to be a problem...

David A. Smth
0
Reply dlzc1 (2362) 2/5/2010 12:28:44 PM

Hello,

as far as I remember you must use STR() on numbers if you use CDX.
It assumes fixed sizes of the indexexpression, maybe because of multiple 
tags in one file.

HTH
Tom


"Ian Boys" <not@given.com> schrieb im Newsbeitrag 
news:bJKdnf6ufJYBcPbWnZ2dnUVZ8kWdnZ2d@bt.com...
> Hi,
> Having spent many years using just NTX indexes. I was starting to have 
> speed issues with a busy client so I decided to change to CDX indexes. I 
> have used the CDX indexes only on the major files that have multiple 
> indexes and the speen incease is significant. This all went well apart 
> from some bizarre stuff, for example:
> I had 6 records indexed on a numeric field, 1000.00 through to 1000.05
> X := 1000
> dbseek(x)               // found
> x += 0.01
> dbseek(x)               // found
> x += 0.01
> dbseek(x)               // found
> x += 0.01
> dbseek(x)               // found
> x += 0.01
> dbseek(x)               // NOT found but why?
> dbseek(1000.04)    // found
> x += 0.01
> dbseek(x)               // NOT found but why?
> dbseek(1000.05)    //found
> This had been working for many years with the NTX index! I ended up 
> indexing on STR(LABNO,9,2) and changing all the seeks and it all worked 
> OK, but why?
>
> My main question is regarding the DBFCDX and SIXCDX drivers. Are CDX 
> indexes created by both systems interchangable? I ended up using the 
> SIXCDX driver as it seemed to work better (too complicated to explain).
>
> I also need to use xBase++ for some of the serial comms stuff that I do as 
> Clipper Tools III does not recognise non-standard (USB and add in card) 
> serial ports. How do I use both CDX and NTX indexes in xBase++ programmes? 
> What combination of DBELOAD and DBEBUILD to I need to acheive this?
>
> Many Thanks
>
> Ian Boys
> DTE Systems Ltd
>
> 


0
Reply hbgmail1 (75) 2/5/2010 2:03:59 PM

hi,

> I also need to use xBase++
> How do I use both CDX and NTX indexes in xBase++ programmes? What 
> combination of DBELOAD and DBEBUILD to I need to acheive this?

please ask in Alaska Newsgroup again while Cl*pper have RDD
other than Xbase++ DATA and ORDER Component.

greetings by OHR
Jimmy
p.s. Xbase++ Version, OS(), Network, Ops lock 


0
Reply AUGE_OHR 2/6/2010 7:42:52 AM

6 Replies
336 Views

(page loaded in 0.186 seconds)

Similiar Articles:






7/17/2012 8:48:21 AM


Reply: