[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openldap-devel
Subject:    Re: MDB_INTEGERDUP in back-mdb's indexer for attr-tables.
From:       ЛеР<leo () yuriev ! ru>
Date:       2015-05-01 2:42:19
Message-ID: CAO2+NUCisMfxSdDTWdG+bfHpyC+2cqyOYfkdmsq9tkuU909aeA () mail ! gmail ! com
[Download RAW message or body]

Oh, yes...
it documented in doxygen as options for  mdb_dbi_open().
Unfortunately I had looked only to comments near of MDB_INTEGERDUP definiti=
on.

Leonid.

2015-05-01 4:57 GMT+03:00 Howard Chu <hyc@symas.com>:
> =D0=9B=D0=B5=D0=BE=D0=BD=D0=B8=D0=B4 =D0=AE=D1=80=D1=8C=D0=B5=D0=B2 wrote=
:
>>
>> Thanks, Howard.
>>
>> It would be nice if some clarification, like these, will be in the lmdb.=
h.
>
>
> MDB_INTEGERDUP is already clearly documented.
>
>>
>> Leonid.
>>
>> 2015-05-01 4:42 GMT+03:00 Howard Chu <hyc@symas.com>:
>>>
>>> =D0=9B=D0=B5=D0=BE=D0=BD=D0=B8=D0=B4 =D0=AE=D1=80=D1=8C=D0=B5=D0=B2 wro=
te:
>>>>
>>>>
>>>> Hi, Howard.
>>>>
>>>> I would like to refine my question.
>>>>
>>>> Currently I develop a mdb_chk tool for deep check LMDB-files, like a
>>>> fsck
>>>> tool.
>>>> It is needed for us, but let this stay aside for now.
>>>>
>>>> On some step I plan to check the size of each key in each DBI with
>>>> MDB_INTEGERKEY and/or MDB_INTEGERDUP flags.
>>>>
>>>> Initially I assumed - if one of these flags is set, the the length of
>>>> all keys must be sizeof(int) or sizeof(long). As will be used the
>>>> corresponding comparison functions (mdb_cmp_int, mdb_cmp_long) , which
>>>> can handle only keys of such sizes.
>>>>
>>>> But this approach has failed. A dbi-tables created for attr by
>>>> mdb_attr_dbs_open() have MDB_DUPSORT|MDB_DUPFIXED|MDB_INTEGERDUP flags
>>>> and may contain records with a 5-byte keys. For instance as the
>>>> 'entryCSN'.
>>>>
>>>> Later you have written that MDB_INTEGERDUP is required.
>>>>
>>>> Now I do not understand how it all works:
>>>>    - MDB_INTEGERDUP is set for attr tables.
>>>>    - indexer could create a 5-byte keys.
>>>>    - mdb-backend set custom comparison function only for MDB_DN2ID
>>>> table.
>>>>    - under debugger I see that md_dcmp is pointed to the default.
>>>>    - assert for key-size in default comparators was not failed while
>>>> "make
>>>> test".
>>>>    - all test are passed without MDB_INTEGERDUP.
>>>>    - but you told MDB_INTEGERDUP is necessary
>>>>
>>>> So,
>>>> - how and when MDB_INTEGERDUP will have an impact?
>>>> - in which cases keys in the table definitely should be sizeof(int) or
>>>> sizeof(long)?
>>>
>>>
>>>
>>> MDB_INTGERKEY means the *keys* must be int/long.
>>> MDB_INTEGERDUP means the *values* must be int/long.
>>>
>>> When either flag is set, all of the corresponding (keys|values) in the =
DB
>>> must be the same size.
>>>
>>> The indexer only uses MDB_INTEGERDUP - it doesn't care what size the ke=
ys
>>> are, but the values must be (longs in this case).
>>>
>>> --
>>>    -- Howard Chu
>>>    CTO, Symas Corp.           http://www.symas.com
>>>    Director, Highland Sun     http://highlandsun.com/hyc/
>>>    Chief Architect, OpenLDAP  http://www.openldap.org/project/
>>
>>
>
>
> --
>   -- Howard Chu
>   CTO, Symas Corp.           http://www.symas.com
>   Director, Highland Sun     http://highlandsun.com/hyc/
>   Chief Architect, OpenLDAP  http://www.openldap.org/project/

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic