[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: [openldap 2.1.12] add a new index in database



Hello,

Helene.Lastennet@alcatel.fr writes:

>> > Hi,
>> >
>> > I need to add a new index in my already existing database.
>> >
>> > I found about it 2 ways:
>> > 1. add the new index in the slapd.conf and use "slapindex" command without running slapd
>> > => "cold" command
>> > => calculate all indexes for all entries
>> > => it takes several days if database with 30000 entries
>>
>> with 25,000 entries in the database
>> marin:/opt/avci/sbin # time ./slapindex -b "o=avci"
>>
>> real    8m21.698s
>> user    3m19.500s
>> sys     2m8.590s
>
> If I well understood, I have to resize my Berkely database to reach this great time ?
> using DB_CONFIG file that I have to create in my backend-bdb directory
> But Do I have to declare this file in the slapd.conf too or
> elsewhere ??

No, by default bdb looks for a DB_CONFIG in its home directory.

>
>> > 2. add the new index in the slapd.conf and make a restore using the "slapadd" command
>> > without running slapd
>> > => "cold" command
>> > => doesn't calculate all indexes for all entries ??? but creates the newindex.bdb file in
>> > the backend directory ?
>> > => it takes 2 hours if database with 30000 entries
>>
>> No, it took only a few minutes (say 5 min) to add the 25,000 entries
>
> ok but is it correct to use slapadd comand to add a new index to an
> already existing database ?

No, slapadd adds entries to an existing database, while slapindex
reindexes the database content.
But if you use slapadd for initital population of your database, the
appropriate indexfiles, as defined in slapd.conf, are created. 

-Dieter

-- 
Dieter Kluenter  | Systemberatung
Tel:040.64861967 | Fax: 040.64891521
mailto: dkluenter(at)dkluenter.de
http://www.avci.de