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

Re: Appropriate index for <= >= filter on generalizedTime

24.09.2012 23:04, Howard Chu ÐÐÑÐÑ:
Roman Rybalko wrote:
24.09.2012 22:23, Howard Chu ÐÐÑÐÑ:
(&(logTime>=201209201440+0400)(logTime<=201209201450+0400)) - 57sec
(|(logTime=20120920144001+0400)(logTime=20120920144008+0400)) - 0.03sec
Use a correct filter. Your clauses above use invalid syntax.
Point me please, where exactly my syntax is invalid?

You must be blind. You wrote:

(&(logTime>=201209201440+0400)(logTime<=201209201450+0400)) - 57sec

Check the proper format of a GeneralizedTime value. You have omitted the seconds field, so you're effectively looking for every entry greater than the year 20, December 09. The index lookup for this will most likely hit every entry in your DB, which is why it takes 57 seconds.
Many thanks for suggestion. Apologies for my extra curiosity.

I tried full GeneralizedTime format (with seconds, with fractions) but the search works also slow.
Even the search
that works less than second and returns 2 entries, when reformatted as
works more than 50 seconds.

According to RFC4517 ( http://tools.ietf.org/html/rfc4517#section-3.3.13), GeneraalizedTime has the syntax:
GeneralizedTime = century year month day hour
                           [ minute [ second / leap-second ] ]
                           [ fraction ]
which means that minutes and seconds may be omitted. Probably that's not implemented... no problem.

openldap version 2.4.23

How may I optimize (&(>=)(<=)) searches?
Roman Rybalko