dbTalk Databases Forums  

Can't add multiple supplemental indexes?

comp.databases.btrieve comp.databases.btrieve


Discuss Can't add multiple supplemental indexes? in the comp.databases.btrieve forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Wendell Buckner
 
Posts: n/a

Default Can't add multiple supplemental indexes? - 07-15-2004 , 11:31 AM






I thought you could add multiple supplemental indexes with you butil or the
GUI utility... Does this work or is there any utility that allows adding
multiple supplemental indexes at one time!



Reply With Quote
  #2  
Old   
Leonard
 
Posts: n/a

Default Re: Can't add multiple supplemental indexes? - 07-16-2004 , 02:28 AM






You should be able to although there are certain "limits".

I believe you can, but am not sure you would want to add more than one
at a time. Sequentially should be fine, but more than one at a time
would probably actually be slower.

The Btrieve API call itself only allows the addition of one key at a
time. For details see:
http://www.pervasive.com/library/doc...PI8.html#34182
from the http://www.pervasive.com/library/

I am sure that like any other Btrieve API call you could make more
than one at a time (multi-threaded using the "id" family of calls or
separate processes), however adding a key to the data file requires
quite a few heavy steps be performed for all but the most trivial of
data sets, e.g. 1) extract the key segments from existing records, 2)
sort the key segments (done in memory if there is enough free memory
or is disk based sort if RAM is not available), 3) write all the new
index pages into the data file. Step 1 requires reading every record
in the file, step 2 sorts them and step 3 writes the new index
information. Step 2 would quickly run out of memory if you made more
than 1 call at a time forcing a disk based sort (slower) on all but
the most trivial of data files.

To try it out you should be able to launch multiple copies of butil or
the maintenance utility and kick them all off at the same time.
I believe that if the 2 or more sequential reads going at the same
time will cause file IO thrashing where the disk head is seeking back
and forth between the two sequential reads unless it all fits in RAM.

Leonard

On Thu, 15 Jul 2004 16:31:47 GMT, "Wendell Buckner"
<wendellbuckner (AT) sbcglobal (DOT) net> wrote:

Quote:
I thought you could add multiple supplemental indexes with you butil or the
GUI utility... Does this work or is there any utility that allows adding
multiple supplemental indexes at one time!



Reply With Quote
  #3  
Old   
Wendell Buckner
 
Posts: n/a

Default Re: Can't add multiple supplemental indexes? - 07-16-2004 , 11:22 AM



Thanks for your response!

I'm more frustrated with the fact that the utilities BUTIL & MAINTENANCE
can't read the key definitions (from a definition file) and apply them one
after the other (doing multiple api calls)... this way I could put all the
supplemental keys into one key definition file instead creating multiple
definition files and having to run butil or the maintenance app N number of
times to add N supplemental keys...

You tool(s) look intereseting
"Leonard" <lharvey (AT) austin (DOT) rr.com> wrote

Quote:
You should be able to although there are certain "limits".

I believe you can, but am not sure you would want to add more than one
at a time. Sequentially should be fine, but more than one at a time
would probably actually be slower.

The Btrieve API call itself only allows the addition of one key at a
time. For details see:
http://www.pervasive.com/library/doc...PI8.html#34182
from the http://www.pervasive.com/library/

I am sure that like any other Btrieve API call you could make more
than one at a time (multi-threaded using the "id" family of calls or
separate processes), however adding a key to the data file requires
quite a few heavy steps be performed for all but the most trivial of
data sets, e.g. 1) extract the key segments from existing records, 2)
sort the key segments (done in memory if there is enough free memory
or is disk based sort if RAM is not available), 3) write all the new
index pages into the data file. Step 1 requires reading every record
in the file, step 2 sorts them and step 3 writes the new index
information. Step 2 would quickly run out of memory if you made more
than 1 call at a time forcing a disk based sort (slower) on all but
the most trivial of data files.

To try it out you should be able to launch multiple copies of butil or
the maintenance utility and kick them all off at the same time.
I believe that if the 2 or more sequential reads going at the same
time will cause file IO thrashing where the disk head is seeking back
and forth between the two sequential reads unless it all fits in RAM.

Leonard

On Thu, 15 Jul 2004 16:31:47 GMT, "Wendell Buckner"
wendellbuckner (AT) sbcglobal (DOT) net> wrote:

I thought you could add multiple supplemental indexes with you butil or
the
GUI utility... Does this work or is there any utility that allows adding
multiple supplemental indexes at one time!





Reply With Quote
  #4  
Old   
Jim Buttery
 
Posts: n/a

Default Re: Can't add multiple supplemental indexes? - 07-17-2004 , 10:34 AM



"Wendell Buckner" <wendellbuckner (AT) sbcglobal (DOT) net> wrote

Quote:
I thought you could add multiple supplemental indexes with you butil or the
GUI utility... Does this work or is there any utility that allows adding
multiple supplemental indexes at one time!
Depending on the size of your tables, the fastest method would
probably be to do a save. Sort that output file with Opt-Tech Sort or
another hi-performance utility that can take advantage of your 2 GB of
RAM. After the sort, do a load (WITHOUT the indices) and then add your
indices. Voila!

Or if you have a couple of extra days, you could always use Microsoft -SQL.
[:-}


Reply With Quote
  #5  
Old   
Bill Bach
 
Posts: n/a

Default Re: Can't add multiple supplemental indexes? - 07-18-2004 , 10:53 PM



BUTIL *CAN* be used to add multiple keys simultaneously -- this is very handy
for when adding keys takes a long time, and you don't want to wait around.
BUTIL @commandFile
This form of the BUTIL command will execute multiple commands (i.e. create index
calls, even) in sequence. See the manuals for full details...
BB


Wendell Buckner wrote:

Quote:
Thanks for your response!

I'm more frustrated with the fact that the utilities BUTIL & MAINTENANCE
can't read the key definitions (from a definition file) and apply them one
after the other (doing multiple api calls)... this way I could put all the
supplemental keys into one key definition file instead creating multiple
definition files and having to run butil or the maintenance app N number of
times to add N supplemental keys...

You tool(s) look intereseting
"Leonard" <lharvey (AT) austin (DOT) rr.com> wrote in message
news:mclef0ps7e6io62460h3trlrvjjhmlots5 (AT) 4ax (DOT) com...
You should be able to although there are certain "limits".

I believe you can, but am not sure you would want to add more than one
at a time. Sequentially should be fine, but more than one at a time
would probably actually be slower.

The Btrieve API call itself only allows the addition of one key at a
time. For details see:
http://www.pervasive.com/library/doc...PI8.html#34182
from the http://www.pervasive.com/library/

I am sure that like any other Btrieve API call you could make more
than one at a time (multi-threaded using the "id" family of calls or
separate processes), however adding a key to the data file requires
quite a few heavy steps be performed for all but the most trivial of
data sets, e.g. 1) extract the key segments from existing records, 2)
sort the key segments (done in memory if there is enough free memory
or is disk based sort if RAM is not available), 3) write all the new
index pages into the data file. Step 1 requires reading every record
in the file, step 2 sorts them and step 3 writes the new index
information. Step 2 would quickly run out of memory if you made more
than 1 call at a time forcing a disk based sort (slower) on all but
the most trivial of data files.

To try it out you should be able to launch multiple copies of butil or
the maintenance utility and kick them all off at the same time.
I believe that if the 2 or more sequential reads going at the same
time will cause file IO thrashing where the disk head is seeking back
and forth between the two sequential reads unless it all fits in RAM.

Leonard

On Thu, 15 Jul 2004 16:31:47 GMT, "Wendell Buckner"
wendellbuckner (AT) sbcglobal (DOT) net> wrote:

I thought you could add multiple supplemental indexes with you butil or
the
GUI utility... Does this work or is there any utility that allows adding
multiple supplemental indexes at one time!




Reply With Quote
  #6  
Old   
Wendell Buckner
 
Posts: n/a

Default Re: Can't add multiple supplemental indexes? - 07-19-2004 , 09:14 AM



thanks... don't know how I missed this in the docs!

"Bill Bach" <bbach (AT) cncdsl (DOT) com> wrote

Quote:
BUTIL *CAN* be used to add multiple keys simultaneously -- this is very
handy
for when adding keys takes a long time, and you don't want to wait around.
BUTIL @commandFile
This form of the BUTIL command will execute multiple commands (i.e. create
index
calls, even) in sequence. See the manuals for full details...
BB


Wendell Buckner wrote:

Thanks for your response!

I'm more frustrated with the fact that the utilities BUTIL & MAINTENANCE
can't read the key definitions (from a definition file) and apply them
one
after the other (doing multiple api calls)... this way I could put all
the
supplemental keys into one key definition file instead creating multiple
definition files and having to run butil or the maintenance app N number
of
times to add N supplemental keys...

You tool(s) look intereseting
"Leonard" <lharvey (AT) austin (DOT) rr.com> wrote in message
news:mclef0ps7e6io62460h3trlrvjjhmlots5 (AT) 4ax (DOT) com...
You should be able to although there are certain "limits".

I believe you can, but am not sure you would want to add more than one
at a time. Sequentially should be fine, but more than one at a time
would probably actually be slower.

The Btrieve API call itself only allows the addition of one key at a
time. For details see:

http://www.pervasive.com/library/doc...PI8.html#34182
from the http://www.pervasive.com/library/

I am sure that like any other Btrieve API call you could make more
than one at a time (multi-threaded using the "id" family of calls or
separate processes), however adding a key to the data file requires
quite a few heavy steps be performed for all but the most trivial of
data sets, e.g. 1) extract the key segments from existing records, 2)
sort the key segments (done in memory if there is enough free memory
or is disk based sort if RAM is not available), 3) write all the new
index pages into the data file. Step 1 requires reading every record
in the file, step 2 sorts them and step 3 writes the new index
information. Step 2 would quickly run out of memory if you made more
than 1 call at a time forcing a disk based sort (slower) on all but
the most trivial of data files.

To try it out you should be able to launch multiple copies of butil or
the maintenance utility and kick them all off at the same time.
I believe that if the 2 or more sequential reads going at the same
time will cause file IO thrashing where the disk head is seeking back
and forth between the two sequential reads unless it all fits in RAM.

Leonard

On Thu, 15 Jul 2004 16:31:47 GMT, "Wendell Buckner"
wendellbuckner (AT) sbcglobal (DOT) net> wrote:

I thought you could add multiple supplemental indexes with you butil
or
the
GUI utility... Does this work or is there any utility that allows
adding
multiple supplemental indexes at one time!






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.