Re: xpath_array with namespaces support - Mailing list pgsql-patches

From Nikolay Samokhvalov
Subject Re: xpath_array with namespaces support
Date
Msg-id e431ff4c0704040715k3f68be79of843330b441c2152@mail.gmail.com
Whole thread Raw
In response to Re: xpath_array with namespaces support  (Bruce Momjian <bruce@momjian.us>)
List pgsql-patches
On 4/4/07, Nikolay Samokhvalov <nikolay@samokhvalov.com> wrote:

So, choosing between two inefficient approaches:
 1. mine, which in some cases use dummy element wrapping, that we could escape;
 2. proposed by you, which leads to +1 parsing.
... I'd definitely choose the first one.

I'd make it a bit more clear.

We have different cases for XML value as input of xpath():
 a. document with prolog ('<?xml...')
 b. document w/o prolog (value that can be represented as a tree -- i.e. we have one root)
 c. fragment with one root element (can be represented as a tree)
 d. fragment w/o root element (cannot be represented as a tree, e.g. 'bla'::xml)

So, the current implementation works w/o wrapping in case a) and use wrapping for cases b)-d).
But we _need_ wrapping _only_ in case d) -- so there is space for optimization (I would keep bit "this value is not a tree" in the value itself).

--
Best regards,
Nikolay

pgsql-patches by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: xpath_array with namespaces support
Next
From: Zoltan Boszormenyi
Date:
Subject: Re: IDENTITY/GENERATED v36 Re: Final version of IDENTITY/GENERATED patch