By default an index slot can only maintain 65535 records before it overflows
and loses precision. Once it loses precision, you tend to get results like
this. If you need to accomodate larger indices you can tweak a constant in
back-bdb/back-bdb.h and recompile. You'll probably also need to increase
LDAP_PVT_THREAD_STACK_SIZE.

can you please guide to do this? Which constant must be changed, which
values are
suitable for this constant and for LDAP_PVT_THREAD_STACK_SIZE?

If I change this values, which other impact does it have of used
memory and the slapd?

The constant is BDB_IDL_LOGN in back-bdb/idl.h. Incrementing it by 1 will
double the range of an index slot before it loses precision. It will also
double the amount of memory used by all of the indexing functions. I think you
can safely double the current value without overrunning the default thread
stack size. But if you go even higher you'll probably need to increase it.