Re: [REVIEW] Re: Fix xpath() to return namespace definitions - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: [REVIEW] Re: Fix xpath() to return namespace definitions
Date
Msg-id 5489AF81.8070709@gmx.net
Whole thread Raw
In response to Re: [REVIEW] Re: Fix xpath() to return namespace definitions  (Ali Akbar <the.apaan@gmail.com>)
Responses Re: [REVIEW] Re: Fix xpath() to return namespace definitions  (Ali Akbar <the.apaan@gmail.com>)
List pgsql-hackers
On 11/5/14 9:50 AM, Ali Akbar wrote:
> I noticed somewhat big performance regression if the xml is large (i use
> PRODML Product Volume sample from energistics.org <http://energistics.org>):
> * Without patch (tested 3 times):
> select unnest(xpath('//a:flow', x,
> ARRAY[['a','http://www.prodml.org/schemas/1series']])) from u;

> Time: 84,012 ms
> Time: 85,683 ms
> Time: 88,766 ms

> * With latest v6 patch (notice the correct result with namespace
> definition):
> 
> select unnest(xpath('//a:flow', x,
> ARRAY[['a','http://www.prodml.org/schemas/1series']])) from u;

> Time: 108,912 ms
> Time: 108,267 ms
> Time: 114,848 ms
> 
> 
> It's 23% performance regression.
> 
> * Just curious, i'm also testing v5 patch performance (notice the
> namespace in the result):
> select unnest(xpath('//a:flow', x,
> ARRAY[['a','http://www.prodml.org/schemas/1series']])) from u;

> Time: 92,552 ms
> Time: 97,440 ms
> Time: 99,309 ms
> 
> The regression is only 13%. I know the xmlCopyNode() version (v6 patch)
> is much more cleaner than v5patch, should we consider the performance
> benefit?

I ran a test using postgres-US.fo built in the PostgreSQL source tree,
which is 38 MB, and ran

select unnest(xpath('//fo:bookmark-title', b, array[array['fo',
'http://www.w3.org/1999/XSL/Format']])) from data;

(Table contains one row only.)

The timings were basically indistinguishable between the three code
versions.

I'll try to reproduce your test.  How big is your file?  Do you have a
link to the actual file?  Could you share your load script?




pgsql-hackers by date:

Previous
From: Marco Nenciarini
Date:
Subject: Re: Too strict check when starting from a basebackup taken off a standby
Next
From: Bruce Momjian
Date:
Subject: Re: Commitfest problems