Re: [HACKERS] add_path optimization

2009-02-28 Thread Robert Haas
On Fri, Feb 27, 2009 at 11:06 PM, Tom Lane wrote: > One other thought to roll around in your head: at the time that the > current add_path logic was designed, compare_pathkeys was ungodly > expensive, which is why the code tries to compare costs first. > We've since introduced the "canonical pathk

[HACKERS] cardinality()

2009-02-28 Thread Andrew Dunstan
We seem to have acquired a cardinality() function with almost no discussion, and it has semantics that are a bit surprising to me. I should have thought cardinality(array) would be the total number of elements in the array. Instead, it seems it is a synonym for array_length(array,1). Is that

Re: [HACKERS] Synchronous replication & Hot standby patches

2009-02-28 Thread Andrew Dunstan
Hannu Krosing wrote: Currently walmgr.py is doing everything from setting up replica to getting up-to-last-second changes to slave's disk. If walmgr.py and its cousins had good documentation there would possibly be much greater acceptance of them. cheers andrew -- Sent via pgsql-hack

Re: [HACKERS] xpath processing brain dead

2009-02-28 Thread Hannu Krosing
On Fri, 2009-02-27 at 22:55 -0500, Andrew Dunstan wrote: > > Hannu Krosing wrote: > >>> > >>> > >> Some of the functions, including some specified in the standard, produce > >> fragments. That's why we have the 'IS DOCUMENT' test. > >> > > > > But then you could use xmlfragments as

Re: [HACKERS] xpath processing brain dead

2009-02-28 Thread Andrew Dunstan
I wrote: I'll test again on some longer fragments since you don't seem convinced. I set up a test with a much larger XML fragment - over 1Mb - basically it's the English source of the SVN Turtle book. The result is that the extra parsing cost is still pretty much unmeasurable: regres

Re: [HACKERS] xpath processing brain dead

2009-02-28 Thread James Pye
On Feb 28, 2009, at 7:53 AM, Andrew Dunstan wrote: This is entirely out of the question for 8.3, as it's a significant change of behaviour. Yep. Even with implicit prefixing, the semantics are very different. What got me thinking about it was this: http://archives.postgresql.org/pgsql-bugs

[HACKERS] encoding conversion functions versus zero-length inputs

2009-02-28 Thread Tom Lane
The REL7_4 members of the buildfarm are all red this morning, with this symptom in initdb: creating template1 database in /usr/src/pg/build-farm-2.17/build/REL7_4_STABLE/pgsql.18854/src/test/regress/./tmp_check/data/base/1... ok initializing pg_shadow... ok enabling unlimited row size for system

Re: [HACKERS] xpath processing brain dead

2009-02-28 Thread Andrew Dunstan
James Pye wrote: sigh.. I got curious. :P On Feb 27, 2009, at 7:19 PM, James Pye wrote: Well, that or force the user to call it explicitly. Attached is the patch that I used to get the results below.. This is just a proof of concept, so it's quite lacking. Notably, it doesn't even try to

Re: [HACKERS] would it be a lot of work, to add optimizations accross unions ?

2009-02-28 Thread Gregory Stark
Grzegorz Jaskiewicz writes: > On 28 Feb 2009, at 11:37, Gregory Stark wrote: >> >> I posted a patch to look for an ordered path for members of a union a while >> back but it still needed a fair amount of work before it was usable. >> > I belive limit it self can't be pushed down, but with order

Re: [HACKERS] would it be a lot of work, to add optimizations accross unions ?

2009-02-28 Thread Grzegorz Jaskiewicz
On 28 Feb 2009, at 11:37, Gregory Stark wrote: Grzegorz Jaskiewicz writes: Say I have: select foo ( select foo from bar1 union all select foo from bar2 union all select foo from bar3 ... ) a order by foo desc limit X; (and I can give you few other examples around the same 'note', say

Re: [HACKERS] would it be a lot of work, to add optimizations accross unions ?

2009-02-28 Thread Gregory Stark
Grzegorz Jaskiewicz writes: > Say I have: > > select foo ( > select foo from bar1 > union all > select foo from bar2 > union all > select foo from bar3 > ... > ) a order by foo desc limit X; > > > (and I can give you few other examples around the same 'note', say with when > foo=N in ou

Re: [HACKERS] xpath processing brain dead

2009-02-28 Thread James Pye
sigh.. I got curious. :P On Feb 27, 2009, at 7:19 PM, James Pye wrote: Well, that or force the user to call it explicitly. Attached is the patch that I used to get the results below.. This is just a proof of concept, so it's quite lacking. Notably, it doesn't even try to identify well-forme

[HACKERS] would it be a lot of work, to add optimizations accross unions ?

2009-02-28 Thread Grzegorz Jaskiewicz
Say I have: select foo ( select foo from bar1 union all select foo from bar2 union all select foo from bar3 ... ) a order by foo desc limit X; (and I can give you few other examples around the same 'note', say with when foo=N in outer subselect) Would anyone consider such optimizat