Re: [PERFORM] Slow select times on select with xpath

2009-09-22 Thread Dimitri Fontaine
astro77 writes: > Kevin Grittner wrote: >> I would try to minimize how many XML values it had to read, parse, and >> search. The best approach that comes to mind would be to use tsearch2 >> techniques (with a GIN or GiST index on the tsvector) to identify >> which rows contain 'fdc3da1f-060f-4c34

Re: [PERFORM] Slow select times on select with xpath

2009-09-21 Thread Ron Mayer
astro77 wrote: > Thanks Kevin. I thought about using tsearch2 but I need to be able to select > exact values on other numerical queries and cannot use "contains" queries. You might be able to make use of a custom parser for tsearch2 that creates something like a single "word" for xml fragments lik

Re: [PERFORM] Slow select times on select with xpath

2009-09-21 Thread astro77
As a follow-up, when I try to create the index like this... CREATE INDEX concurrently idx_object_nodeid2 ON object USING btree( xpath('/a:root/a:Identification/b:ObjectId/text()', serialized_object, ARRAY [ ARRAY['a', 'http://schemas.datacontract.org/20

Re: [PERFORM] Slow select times on select with xpath

2009-09-21 Thread astro77
Thanks Kevin. I thought about using tsearch2 but I need to be able to select exact values on other numerical queries and cannot use "contains" queries. It's got to be fast so I cannot have lots of records returned and have to do secondary processing on the xml for the records which contain the exa

Re: [PERFORM] Slow select times on select with xpath

2009-09-21 Thread astro77
CREATE INDEX CONCURRENTLY idx_serializedxml ON "object" (serialized_object ASC NULLS LAST); yields the error: ERROR: data type xml has no default operator class for access method "btree" The same error occurs when I try to use the other access methods as well. On Thu, Sep 3, 2009 at 4:06 PM

Re: [PERFORM] Slow select times on select with xpath

2009-09-03 Thread Robert Haas
On Thu, Sep 3, 2009 at 4:06 PM, astro77 wrote: > I was receiving an error that an XML field does not support the various > indexes available in postgresql. Please post what happens when you try. > Is there an example of how to do this > properly? Not sure. ...Robert -- Sent via pgsql-performa

Re: [PERFORM] Slow select times on select with xpath

2009-09-03 Thread astro77
I was receiving an error that an XML field does not support the various indexes available in postgresql. Is there an example of how to do this properly? Robert Haas wrote: > > On Wed, Sep 2, 2009 at 11:04 AM, astro77 wrote: >> >> I've got a table set up with an XML field that I would like to se

Re: [PERFORM] Slow select times on select with xpath

2009-09-03 Thread Robert Haas
On Wed, Sep 2, 2009 at 11:04 AM, astro77 wrote: > > I've got a table set up with an XML field that I would like to search on with > 2.5 million records. The xml are serialized objects from my application > which are too complex to break out into separate tables. I'm trying to run a > query similar

Re: [PERFORM] Slow select times on select with xpath

2009-09-03 Thread Kevin Grittner
astro77 wrote: > I've got a table set up with an XML field that I would like to search on > with > 2.5 million records. The xml are serialized objects from my application > which are too complex to break out into separate tables. I'm trying to run a > query similar to this: > > SELECT s