Exists but doesn't
Tuesday, 23 September 2014 · 3 messages
GJ
Gerald de Jong23 Sep 2014 10:59 #
While trying out 8.0-SNAPSHOT I get something strange. There is an exists query which gives true where the answer should be false. There is no dataset with @name='DiMu__abm', yet exists gives "true". The subsequent query shows what is actually in the XML.
Quoted text · 1 line
> xquery
exists(doc('narthex_dimcon/narthex_dimcon.xml')/narthex-datasets/dataset[@name='DiMu__abm']) true
Query executed in 5.14 ms.
Quoted text · 1 line
> xquery doc('narthex_dimcon/narthex_dimcon.xml')
<narthex-datasets>
<dataset name="RCE_Beeldbank__adlib">
<origin>
<type>origin-drop</type>
<who>?</who>
<time>2014-09-23T10:05:34.436+02:00</time>
</origin>
<status>
<state>state-saved</state>
<time>1411460347570</time>
<percent>0</percent>
<workers>0</workers>
<error/>
</status>
<delimit>
<recordRoot>/adlibXML/recordList/record</recordRoot>
<uniqueId>/adlibXML/recordList/record/priref</uniqueId>
<recordCount>401960</recordCount>
</delimit>
<namespaces>
<xsi>http://www.w3.org/2001/XMLSchema-instance</xsi>
</namespaces>
<harvest/>
</dataset>
</narthex-datasets>
Query executed in 3.03 ms.--
Delving BV, Vasteland 8, Rotterdam
http://www.delving.eu
http://twitter.com/fluxe
skype: beautifulcode
+31629339805
CG
Christian Grün23 Sep 2014 11:29 #
Hi Gerald,
Could you possibly provide me with a reproducible example? If that's not possible, I would be interested..
* in the query info
* what happens if you rebuild the index
* if you get a result when calling
doc('narthex_dimcon/narthex_dimcon.xml')/narthex-datasets/dataset[@name='DiMu__abm']
Thanks,
Christian
Quoted text · Gerald de Jong · 43 lines
> While trying out 8.0-SNAPSHOT I get something strange. There is an exists > query which gives true where the answer should be false. There is no > dataset with @name='DiMu__abm', yet exists gives "true". The subsequent > query shows what is actually in the XML. > >> xquery >> exists(doc('narthex_dimcon/narthex_dimcon.xml')/narthex-datasets/dataset[@name='DiMu__abm']) > true > Query executed in 5.14 ms. >> xquery doc('narthex_dimcon/narthex_dimcon.xml') > <narthex-datasets> > <dataset name="RCE_Beeldbank__adlib"> > <origin> > <type>origin-drop</type> > <who>?</who> > <time>2014-09-23T10:05:34.436+02:00</time> > </origin> > <status> > <state>state-saved</state> > <time>1411460347570</time> > <percent>0</percent> > <workers>0</workers> > <error/> > </status> > <delimit> > <recordRoot>/adlibXML/recordList/record</recordRoot> > <uniqueId>/adlibXML/recordList/record/priref</uniqueId> > <recordCount>401960</recordCount> > </delimit> > <namespaces> > <xsi>http://www.w3.org/2001/XMLSchema-instance</xsi> > </namespaces> > <harvest/> > </dataset> > </narthex-datasets> > Query executed in 3.03 ms. > > -- > Delving BV, Vasteland 8, Rotterdam > http://www.delving.eu > http://twitter.com/fluxe > skype: beautifulcode > +31629339805
GJ
Gerald de Jong23 Sep 2014 13:54 #
Hmm.. very interesting:
Quoted text · Christian Grün · 1 line
> xquery
exists(doc('narthex_dimcon/narthex_dimcon.xml')/narthex-datasets/dataset[@name='DiMu__abm']) true
Query executed in 5.11 ms.
Quoted text · Christian Grün · 1 line
> open narthex_dimcon
Database 'narthex_dimcon' was opened in 2.31 ms.
Quoted text · Christian Grün · 1 line
> optimize
Database 'narthex_dimcon' was optimized in 11.51 ms.
Quoted text · Christian Grün · 1 line
> xquery
exists(doc('narthex_dimcon/narthex_dimcon.xml')/narthex-datasets/dataset[@name='DiMu__abm']) false
Query executed in 7.26 ms.
This only seems to be the case with 8.0 by the way. I hadn't seen it before with 7.9. I guess it's like auto-optimize is turned off.
Quoted text · Christian Grün · 63 lines
On Tue, Sep 23, 2014 at 11:29 AM, Christian Grün <christian.gruen at gmail.com> wrote: > Hi Gerald, > > Could you possibly provide me with a reproducible example? If that's > not possible, I would be interested.. > > * in the query info > * what happens if you rebuild the index > * if you get a result when calling > > doc('narthex_dimcon/narthex_dimcon.xml')/narthex-datasets/dataset[@name='DiMu__abm'] > > Thanks, > Christian > > > > While trying out 8.0-SNAPSHOT I get something strange. There is an > exists > > query which gives true where the answer should be false. There is no > > dataset with @name='DiMu__abm', yet exists gives "true". The subsequent > > query shows what is actually in the XML. > > > >> xquery > >> > exists(doc('narthex_dimcon/narthex_dimcon.xml')/narthex-datasets/dataset[@name='DiMu__abm']) > > true > > Query executed in 5.14 ms. > >> xquery doc('narthex_dimcon/narthex_dimcon.xml') > > <narthex-datasets> > > <dataset name="RCE_Beeldbank__adlib"> > > <origin> > > <type>origin-drop</type> > > <who>?</who> > > <time>2014-09-23T10:05:34.436+02:00</time> > > </origin> > > <status> > > <state>state-saved</state> > > <time>1411460347570</time> > > <percent>0</percent> > > <workers>0</workers> > > <error/> > > </status> > > <delimit> > > <recordRoot>/adlibXML/recordList/record</recordRoot> > > <uniqueId>/adlibXML/recordList/record/priref</uniqueId> > > <recordCount>401960</recordCount> > > </delimit> > > <namespaces> > > <xsi>http://www.w3.org/2001/XMLSchema-instance</xsi> > > </namespaces> > > <harvest/> > > </dataset> > > </narthex-datasets> > > Query executed in 3.03 ms. > > > > -- > > Delving BV, Vasteland 8, Rotterdam > > http://www.delving.eu > > http://twitter.com/fluxe > > skype: beautifulcode > > +31629339805 >
--
Delving BV, Vasteland 8, Rotterdam
http://www.delving.eu
http://twitter.com/fluxe
skype: beautifulcode
+31629339805
Written for BaseX 7.9. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery