2012/1/4 Jan Haderka <jan.hade...@magnolia-cms.com>: > IMHO changing indices will not help (but I'll be happy if you proof me wrong). > > http://www.day.com/specs/jcr/1.0/6.6.5.2_jcr_contains_Function.html > - this function is doing full text search, so I don't think indices are > involved.
Good point. This is actually just coming from a Restrictions.in("MetaData/@mgnl:template", templates). I think that somebody didn't expect that that would result in multiple contains. The simplified query with mainly the constraints on 'date' does perform better, but still is quite slow. This boils down to + AndQueryNode + RelationQueryNode: Op: >= Prop=@{}date Type=DATE Value=Thu Jan 01 02:00:00 CET 1970 + RelationQueryNode: Op: <= Prop=@{}date Type=DATE Value=Mon Jan 02 16:57:33 CET 2012 I'm not sure how that would work, but I'd say that an index should be able to do that pretty quickly. As far as I could see (with luke) there is no index on the date property. So we figured that we perhaps could simply add such an index or so. > - looking at your query you can simplify it to one use of the function like > ... jcr:contains(MetaData/@mgnl:template, '3v12NewsOverview OR 3v12News OR > 3v12SubsiteNewsOverview OR 3v12SubsiteNews') ... or if you really need to be > explicit use direct comparison ... MetaData/@mgnl:template = > '3v12NewsOverview' or ... Thanks. I'm going to look into that immediately. > - query translator [1] is a good tool to use to evaluate the "execution plan" > for any query and see what kind of impact will any changes made to the query > make (if any) Looks useful. Thanks. > Also please note that as of JCR-2.0 XPath have been deprecated (although > admittedly some kinds of search, like child axis is not supported in SQL) Actually, this was made using 'Criteria', so in this case the xpath query was just intermediate. Michiel -- mihxil' http://meeuw.org nl_NL eo_XX en_US ---------------------------------------------------------------- For list details, see http://www.magnolia-cms.com/community/mailing-lists.html Alternatively, use our forums: http://forum.magnolia-cms.com/ To unsubscribe, E-mail to: <user-list-unsubscr...@magnolia-cms.com> ----------------------------------------------------------------