Re: xpath_array with namespaces support

From: "Nikolay Samokhvalov" <samokhvalov(at)gmail(dot)com>
To: "Peter Eisentraut" <peter_e(at)gmx(dot)net>
Cc: pgsql-patches(at)postgresql(dot)org, "Bruce Momjian" <bruce(at)momjian(dot)us>
Subject: Re: xpath_array with namespaces support
Date: 2007-04-04 14:15:49
Message-ID: e431ff4c0704040715k3f68be79of843330b441c2152@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

On 4/4/07, Nikolay Samokhvalov <nikolay(at)samokhvalov(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Markus Schiltknecht 2007-04-04 14:21:29 Re: Auto Partitioning
Previous Message Andrew Dunstan 2007-04-04 14:07:39 Re: Auto Partitioning

Browse pgsql-patches by date

  From Date Subject
Next Message Markus Schiltknecht 2007-04-04 14:21:29 Re: Auto Partitioning
Previous Message Andrew Dunstan 2007-04-04 14:07:39 Re: Auto Partitioning