[Zope-CMF] Optimizing catalog queries
Tres Seaver
tseaver at zope.com
Tue Nov 11 09:17:16 EST 2003
On Tue, 2003-11-11 at 01:08, Gitte Wange wrote:
> tir, 2003-11-11 kl. 01:33 skrev Tres Seaver:
> > On Mon, 2003-11-10 at 14:40, Chris McDonough wrote:
> > > DateRangeIndexes and DateIndexes are broken for dates past Y2038 (see
> > > http://www.dewtronics.com/y2038.html). I think CMF's DublinCore
> > > CEILING_DATE needs to change to one second before the Y2038 cutoff. You
> > > could try this in your own copy, leaving the date/daterange indexes the
> > > way they are...
> >
> > Actually, it would be better to change the CMF's DublinCore to return
> > None instead of the bogus ceiling / floor dates; the DRIs will then do
> > the "Right Thing" about half-open intervals.
> >
> > If you get this done, I would accept it as a patch, even for the 1.3
> > line (assuming that we ever have to release another 1.3.x).
>
> Making the patch won't be difficult ...
> My problem is that I have objects that already have saved their metadata
> with such a large date :-(
> Maybe the patch should include an update method, that would loop through
> the entire content of the site and set the date to year 2037 if year is
> to high ?
Nope; loop through the site and set the 'expiration_date' to 'None' if
it is equal to the old _CEILING_DATE. The DateIndex and DateRangeIndex
classes know how to deal with that case properly: DRI uses 'None'
values on the endpoints to label the range as "half-open" (or
"full-open" if both are 'None'); DI doesn't catalog objects with 'None'
at all (which will break some range query use cases, but most of those
really want the DRI anyway).
The conversion script should run *before* the old FieldIndexes
disappear, as searching those indexes for _CEILING_DATE / _FLOOR_DATE
should find exactly the objects which need repair. Once the objects are
cleaned up, then replace the FieldIndexes with the appropriate DI / DRI
versins, and reindex all content.
> I will make such a script for my own site at least ...
To be clear: my proposal is to remove the whole _CELIING_DATE /
_FLOOR_DATE hack from the CMF, relying on 'None' to indicate the
"doesn't expire" / "always effective" cases.
Tres.
--
===============================================================
Tres Seaver tseaver at zope.com
Zope Corporation "Zope Dealers" http://www.zope.com
More information about the Zope-CMF
mailing list