dbTalk Databases Forums  

B-Tree Index Usage

comp.databases.pick comp.databases.pick


Discuss B-Tree Index Usage in the comp.databases.pick forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Peter McMurray
 
Posts: n/a

Default B-Tree Index Usage - 08-08-2006 , 11:18 PM






Hi
Since I hope that Raining Data will be doing a significant amount of work on
D3 Indices in the not too distant future - Tdata and Mark Brown have
confirmed my results and requests are now being prepared - I would
appreciate your opinions on how to form or perhaps dump my request.

I have been very surprised at the number of people who have indicated
verbally or through cdp that translates to index across two files are a bad
idea. To my mind this indicates a problem with the implementation methods
not the design. The procedure is not rocket science.
For example a file (I can't call it a master file according to DAWN :-) )
contains the name and another file contains multiple addresses.
On creation of an address we write an index Name:Address key
On alteration of a name we loop through, delete the old Name:Address key and
create the new one. Note that this sort of thing is even rarer these days
than it was 20 years ago as many girls retain their own account names on
marriage these days, so it is not a big load.

What is missing in the D3 scenario is a re-index(filename,oldkey,newkey)
that can be used from basic or a trigger. In fact it almost sounds like the
defunct b-correlative but that was purely to get round the problem of trying
to write programs using/abusing an editor instead of the proper programming
language - imagine trying to write programs with VI as the driver.

By the way my latest testing indicates that a Sort will not use a date index
unless there is a limitation on it.
SORT FILE BY DATEINDEXADI will not use the index according to the result
message
SORT FILE BY DATEINDEXADI NE "1-4-2006" will use the index.
To make life even more interesting there is a difference in date
interpretation betwwen ACCESS and a program. If one forgets to SET-DATE-EUR
to get the proper format the program DM,BP, DATE will still give one the
correct format as per the setting on your winbox whereas ACCESS will try and
use the US format. This can lead to a little head scratching for a minute
or two.

Peter McMurray



Reply With Quote
  #2  
Old   
Scott Ballinger
 
Posts: n/a

Default Re: B-Tree Index Usage - 08-09-2006 , 05:06 PM






Peter McMurray wrote:
Quote:
By the way my latest testing indicates that a Sort will not use a date index
unless there is a limitation on it.
You are right, D3 will select indexed dates if specified directly, but
not relatively, e.g.

select invoices with date ge 8-1-06 and le 1-8-06 (t

will not use the index, but

select invoices with date eq 8-1-06 8-2-06 8-3-06 8-4-06 8-5-06 8-6-06
8-7-06 8-8-06 (t

will use the index. You can tell whether or not the index was used in
the select by the message number returned: [4041] indicates the result
is from the index, [401] indicates a non-index result.

What I end up doing for files with date indexes is make a basic program
that accepts a starting and ending date, then builds an explicit list
of all the dates in between, then chains to a select like:

select invoices with date eq "01-01-05" "01-02-05" "01-03-05" ...
"12-31-05"

It seems that the date range can be pretty large (10 years works, 11
doesn't?) before the tcl command line buffer overflows.

BTW, Universe indexes do handle dates correctly, e.g.

select invoices with date ge 1-1-06 and le 12-31-06

works quickly, as expected (but I don't know how to test to prove that
the index was used, except for the obvious increase in speed).

/Scott Ballinger
Pareto Corporation
Edmonds WA USA
206 713 6006



Reply With Quote
  #3  
Old   
Excalibur
 
Posts: n/a

Default Re: B-Tree Index Usage - 08-09-2006 , 05:43 PM



Hi
It seems that we have a long way to go to get indices fixed. I may be
banging my head against a brick wall.
Peter McMurray
"Scott Ballinger" <scott.ballinger (AT) gmail (DOT) com> wrote

Quote:
Peter McMurray wrote:
By the way my latest testing indicates that a Sort will not use a date
index
unless there is a limitation on it.

You are right, D3 will select indexed dates if specified directly, but
not relatively, e.g.

select invoices with date ge 8-1-06 and le 1-8-06 (t

will not use the index, but

select invoices with date eq 8-1-06 8-2-06 8-3-06 8-4-06 8-5-06 8-6-06
8-7-06 8-8-06 (t

will use the index. You can tell whether or not the index was used in
the select by the message number returned: [4041] indicates the result
is from the index, [401] indicates a non-index result.

What I end up doing for files with date indexes is make a basic program
that accepts a starting and ending date, then builds an explicit list
of all the dates in between, then chains to a select like:

select invoices with date eq "01-01-05" "01-02-05" "01-03-05" ...
"12-31-05"

It seems that the date range can be pretty large (10 years works, 11
doesn't?) before the tcl command line buffer overflows.

BTW, Universe indexes do handle dates correctly, e.g.

select invoices with date ge 1-1-06 and le 12-31-06

works quickly, as expected (but I don't know how to test to prove that
the index was used, except for the obvious increase in speed).

/Scott Ballinger
Pareto Corporation
Edmonds WA USA
206 713 6006




Reply With Quote
  #4  
Old   
Ross Ferris
 
Posts: n/a

Default Re: B-Tree Index Usage - 08-09-2006 , 05:57 PM




Excalibur wrote:
Quote:
Hi
It seems that we have a long way to go to get indices fixed. I may be
banging my head against a brick wall.
Peter McMurray
Peter,

You might want to check out 7.5 --> I seem to recall there being
something in the Resolutions & Enhancements that talked about the use
of indexed fields being "improved" in AQL. ... I'll check when I get
back to the office.

FWIW, 7.5 seems to be stable so far, and has certainly resolved so
outstanding issues we were having at the site involved ... fingers
crossed, and looking forward to play with the Linux BETA

Not my place (has that ever stopped me?) but if anyone has a keen
interest in D3/Linux platform, and wants a "heads up" on the new
features, consider contacting RD & sign up for the beta if you have the
resources .... and for any D3 users out there who HAVEN'T already
downloaded the updated 7.5 documentation from the NT site, do yourself
a favour & grab a copy. All sorts of "gems" that were previously hidden
have been exposed - certainly a big step in the right direction I
believe



Reply With Quote
  #5  
Old   
Bruce Nichol
 
Posts: n/a

Default Re: B-Tree Index Usage - 08-09-2006 , 05:59 PM



Goo'day,

Whale oil beef ........ !!!!

On 9 Aug 2006 15:06:46 -0700, "Scott Ballinger"
<scott.ballinger (AT) gmail (DOT) com> wrote:


Quote:
BTW, Universe indexes do handle dates correctly, e.g.

select invoices with date ge 1-1-06 and le 12-31-06

I was about to leap in, indignant to the core.... That COULDN'T work!!
(No, not becasue of the back-arsewards date format..... <grin>)

Thought I: T'would have to be ...with date ge "..." and DATE le
"..."

But, no. Tested on my last remaining UV old boiler and it works as
stated....

Never too old to learn..... Now off to OpenQM to see..... Yep! That,
works there, too...
Quote:
works quickly, as expected (but I don't know how to test to prove that
the index was used, except for the obvious increase in speed).
What more evidence do you need? A signed Statuory Declaration??
(There are published rules for when and if indices are used, however.
I believe the rules can be trusted, most unlike <insert your
preference>........)

Errrr.... "Why change?".... Now - MORE than 'nuff said.

The longer this sort of debate goes on, the more satisfied I am that
we made the right decision (AP->UV) in 1995...... let alone the 2004
decision (UV->OpenQM)......

Regards,

Bruce Nichol
Talon Computer Services
ALBURY NSW Australia

http://www.taloncs.com.au

If it ain't broke, fix it until it is....


Reply With Quote
  #6  
Old   
Peter McMurray
 
Posts: n/a

Default Re: B-Tree Index Usage - 08-09-2006 , 09:48 PM



Hi Ross
All my remarks are directed at 7.5 although I have checked some of the
results back against 7.4.4.
The new documentation is certainly easier to navigate. However I am
concerned about the major discrepancies that would not aid a person starting
off. For example the Algebraic Processing Code creation is shown only with
the multi value layout which crashes with creation of indices eg
a1(t1,40]mct) how a learner is supposed to guess that this should be
a1(t1,40)(mct) is somewhat beyond me. A second source of concern is that
the file writeup says that only the first 24 characters are used for a
comparison with no indication as to whether or not this applies to indices.

As for the following statement under Basic Transaction
CAUTION-This function should not be used directly in the context of a
user-written FlashBASIC or BASIC program as it allows violating the
theoretical structure of a transaction.
I am baffled for the moment.

If you want to see some really useful stuff out of the REF account you need
to run the BRIZ PEHELP html version of it, there are all sorts of articles
etc and it is a beautiful demonstration of how to present documentation.

Peter McMurray

"Ross Ferris" <rossf (AT) stamina (DOT) com.au> wrote

Quote:
Excalibur wrote:
Hi
It seems that we have a long way to go to get indices fixed. I may be
banging my head against a brick wall.
Peter McMurray

Peter,

You might want to check out 7.5 --> I seem to recall there being
something in the Resolutions & Enhancements that talked about the use
of indexed fields being "improved" in AQL. ... I'll check when I get
back to the office.

FWIW, 7.5 seems to be stable so far, and has certainly resolved so
outstanding issues we were having at the site involved ... fingers
crossed, and looking forward to play with the Linux BETA

Not my place (has that ever stopped me?) but if anyone has a keen
interest in D3/Linux platform, and wants a "heads up" on the new
features, consider contacting RD & sign up for the beta if you have the
resources .... and for any D3 users out there who HAVEN'T already
downloaded the updated 7.5 documentation from the NT site, do yourself
a favour & grab a copy. All sorts of "gems" that were previously hidden
have been exposed - certainly a big step in the right direction I
believe




Reply With Quote
  #7  
Old   
Peter McMurray
 
Posts: n/a

Default Re: B-Tree Index Usage - 08-09-2006 , 10:02 PM




"Bruce Nichol" <reverse_ecurb (AT) taloncs (DOT) com.au> wrote

Quote:
Goo'day,

Whale oil beef ........ !!!!

On 9 Aug 2006 15:06:46 -0700, "Scott Ballinger"
scott.ballinger (AT) gmail (DOT) com> wrote:


BTW, Universe indexes do handle dates correctly, e.g.

select invoices with date ge 1-1-06 and le 12-31-06


I was about to leap in, indignant to the core.... That COULDN'T work!!
(No, not becasue of the back-arsewards date format..... <grin>)

Thought I: T'would have to be ...with date ge "..." and DATE le
"..."

But, no. Tested on my last remaining UV old boiler and it works as
stated....

Hi Bruce
As you say, ignoring the back to front layout, would you believe that some
of us have never done it any other way and it is now covered in the new
manual with particular reference as to how it will affect indices.
Indexes are used when multiple values are specified, as long as they are
part of the same selection clause. For example:

select filename with attr "value1""value2"

I am tempted by OpenQM but I have a deep faith that D3 will prosper and it
is up to me to shout a little louder instead of using work-arounds. Mind
you I think that Superb still has a lot of life in it.

Peter McMurray




Reply With Quote
  #8  
Old   
Tony Gravagno
 
Posts: n/a

Default Re: B-Tree Index Usage - 08-09-2006 , 10:39 PM



"Peter McMurray" wrote:

Quote:
Hi Ross
All my remarks are directed at 7.5 although I have checked some of the
results back against 7.4.4.
Ross is right, v7.5 now supports date ranges using:
GE x AND LE y


About the rest of it, I'm trying to avoid this discussion because my
response is the same for pretty much every posting. If the software or
docs are wrong, email your support provider for a change or
clarification.

BTW, note that v7.5 is free to anyone on a support agreement. This
release was originally D3 8.0 but many of the fixes and enhancements
were pulled back into v7 to make them available without an extra
purchase. I look forward to working with a great many of these
features and I applaud RD for this particular business decision.

If you don't like what you have now, considering that at least you're
getting it for free. It could have cost you a lot more to discover
all the new bugs and other things you don't like.





Reply With Quote
  #9  
Old   
GVP
 
Posts: n/a

Default Re: B-Tree Index Usage - 08-09-2006 , 11:25 PM



Hello Tony,

What about differences between new D3NT and D3Linux?
How I can use new features of D3NT if they not supported in D3Linux?

Regards,
Grigory


Reply With Quote
  #10  
Old   
Bruce Nichol
 
Posts: n/a

Default Re: B-Tree Index Usage - 08-09-2006 , 11:38 PM



Goo'day, says he, with tongue well and truly wedged in his
cheek.....

On Wed, 09 Aug 2006 20:39:53 -0700, Tony Gravagno
<g6q3x9lu53001 (AT) sneakemail (DOT) com.invalid> wrote:

Quote:
"Peter McMurray" wrote:

Hi Ross
All this on-going "indexing" saga reminds me that there was an
extremely good, as in "never any problems, always worked", and
cost-effective third-party indexing tool available for R83 ere Pick
Systems released any indexing stuff....

Unfortunately, the name of this product escapes me now, but I do
remember having to dimension T. ARRAY (10) to use it. So was it
called "T." something????

Anyway some of you might like to resurrect it - if it has fallen by
the wayside, in light of the current controversy....

Rolling over and going back to sleep...

Regards,

Bruce Nichol
Talon Computer Services
ALBURY NSW Australia

http://www.taloncs.com.au

If it ain't broke, fix it until it is....


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.