From: Pieter D. <pie...@gm...> - 2008-09-05 07:07:46
|
Hi list, We are trying to speed up parts of our application with indexes. They really help, but we see some differences (besides performance) between query behavior with and without index. Our query looks like this: doc("...")//element()[Time gt xs:dateTime("2008-03-21T13:49:06.54+02:00")] And our index configuration: <collection xmlns="http://exist-db.org/collection-config/1.0"> <validation mode="yes"/> <index> <create qname="Time" type="xs:dateTime"/> </index> </collection> Our problem is that this query only works when the index is configured. Running it without index gives the following error message: XPTY0004: can not compare xs:string('2008-03-21T12:37:14.245+01:00') with xs:dateTime('2008-03-21T13:49:06.54+02:00'). It looks like Time is silently cast to an xs:dateTime with index, but treated as an xs:string without it. Adding an xs:dateTime cast around Time works in both cases, but somehow prevents the index from being used, which defeats the purpose of creating it in the first place. Is there any way to work around this? I tried this with revision 7446 of the exist-stable-1.2 branch and exist-1.2.4. With kind regards, Pieter Deelen |