From: Patrick B. <pat...@jo...> - 2011-12-01 20:21:12
|
This would be a great thing to test and provide back to the community. While, I would guess that the first query would be faster, it would be awesome to have actual benchmarks to refer to. I've really wanted to start a community database of performance data and optimization information for a while... On Thu, Dec 1, 2011 at 8:07 AM, Joe Wicentowski <jo...@gm...> wrote: > Hi Stéphane, > > > First of all I apologize if this is a naive question because just a > matter of style. > > No, good question! > > > doc('/db/mycol/1.xml')/Data > > vs. > > collection('/db/mycol')/Data[@id = '1'] > > > > Does it make any difference, is there a best way to write this query ? > > The queries are effectively identical, and I doubt you would notice a > difference in performance. But the first query likely has a slight > performance edge over the second one. The first query will be > resolved solely based on eXist's structural index, whereas the second > query requires that eXist read the contents of the @id attribute. By > default, reading the content of a node means leaving the indexes and > accessing the DOM - which can be a slow operation. But you can speed > up the performance of such filters by defining a range index on @id. > > Some good reading on this topic can be found at > http://exist-db.org/indexing.html and http://exist-db.org/tuning.html > (and with in that article, see esp. > http://exist-db.org/tuning.html#d1973e497). > > Cheers, > Joe > > > ------------------------------------------------------------------------------ > All the data continuously generated in your IT infrastructure > contains a definitive record of customers, application performance, > security threats, fraudulent activity, and more. Splunk takes this > data and makes sense of it. IT sense. And common sense. > http://p.sf.net/sfu/splunk-novd2d > _______________________________________________ > Exist-open mailing list > Exi...@li... > https://lists.sourceforge.net/lists/listinfo/exist-open > -- Patrick Bosek Jorsek Software Cell (585) 820 9634 Office (877) 492 2960 Jorsek.com |