to our documentation.
MAXCATS). We have fixed that; a new snapshot is available [1,2].
On Tue, Apr 6, 2021 at 4:01 PM Beck, Julia <
J.Beck@ub.uni-frankfurt.de> wrote:
>
> Dear all,
>
>
> The option MAXLEN tricked me today which is why I need some advice.
>
> I have the problem that I have a query that normally works smoothly but with one certain data set, it's really slow. I think it's because at some point in the query I am trying to match a value from the index that is cut due to MAXLEN of 96 (I made a test: the query is fast for values below 96, but 97 and above is slow). So I followed the documentation and created the database again with a MAXLEN of 200 instead. What tricked me was that whenever I optimize the database, MAXLEN is back to 96.
>
>
> The documentation says about MAXLEN:
>
> "Specifies the maximum length for strings to be stored in index structures. The value of this option will be assigned once to a new database, and can *only be changed* by creating a new database or doing a full optimization."
>
> I assumed "full optimization" means db:optimize with $all is true(). But I noticed that the value of MAXLEN also changes when I do db:optimize without true().
> For Optimization, the documentation states:
>
> If ALL is specified, all database structures are completely reconstructed. The database size will be reduced, and all orphaned data will be deleted.
> Without ALL, only the outdated index structures and database statistics will be updated. If the database is completely up-to-date, nothing will be done.
> Database options will be adopted from the original database. Only AUTOOPTIMIZE and (if ALL is specified) UPDINDEX will be adopted from the current options.
>
> If I understand correctly from the last bullet point, it says that the MAXLEN option is not considered from the original database as it's an index option. For the second bullet point I would not say though, that "nothing will be done", if the database is completely up-to-date. Because when I create a new database "test" with a MAXLEN of 200 and do a db:optimize("test"), MAXLEN goes back to 96.
> How to keep MAXLEN at the value I set? Do I have to set it every time, I do an optimization? Like db:optimize("test", map {"maxlen": 200})? That seems to work but it feels a bit over the top, considering that I have many queries with optimizations that I would need to adapt for this one data set then. What is the reason for resetting MAXLEN during optimization?
>
> Best wishes,
>
> Julia
>