Re: [HACKERS] Our regex vs. POSIX on "longest match"

2012-03-04 Thread Robert Haas
On Sun, Mar 4, 2012 at 3:20 PM, Tom Lane wrote: > hubert depesz lubaczewski writes: >> I stand on position that mixing greedy and non-greedy operators should >> be possible, and that it should work according to POLA - i.e. greedines >> of given atom shouldn't be influenced by other atoms. > > [ s

Re: [HACKERS] Our regex vs. POSIX on "longest match"

2012-03-04 Thread Brendan Jurd
On 5 March 2012 04:34, Tom Lane wrote: > Brendan Jurd writes: >> On 4 March 2012 17:53, Tom Lane wrote: >>> Brendan Jurd writes: >> While it's true that POSIX doesn't contemplate non-greed, after >> reading the spec I would have expected an expression *as a whole* to >> still prefer the longest

Re: GiST for range types (was Re: [HACKERS] Range Types - typo + NULL string constructor)

2012-03-04 Thread Tom Lane
Alexander Korotkov writes: > On Mon, Jan 30, 2012 at 1:39 AM, Jeff Davis wrote: >> Marking "ready for committer", but please apply my comment fixes at your >> discretion. > Patch with your comment fixes is attached. Applied with revisions, some cosmetic, some not so much.

Re: [HACKERS] review: CHECK FUNCTION statement

2012-03-04 Thread Alvaro Herrera
Excerpts from Pavel Stehule's message of dom mar 04 16:33:08 -0300 2012: > > Hello > > 2012/3/4 Alvaro Herrera : > >                     CHECK FUNCTION > > - > >  In function: 'f()' > >  error:42P01:2:sentencia SQL:no existe la relación «f

Re: [HACKERS] Parameterized-path cost comparisons need some work

2012-03-04 Thread Robert Haas
On Sun, Mar 4, 2012 at 12:20 AM, Tom Lane wrote: > After looking at the results, I think that the fallacy in what we've > been discussing is this: a parameterized path may well have some extra > selectivity over a less-parameterized one, but perhaps *not enough to be > meaningful*.  The cases I wa

Re: [HACKERS] Collect frequency statistics for arrays

2012-03-04 Thread Tom Lane
BTW, one other thing about the count histogram: seems like we are frequently generating uselessly large ones. For instance, do ANALYZE in the regression database and then run select tablename,attname,elem_count_histogram from pg_stats where elem_count_histogram is not null; You get lots of ent

Re: [HACKERS] Collect frequency statistics for arrays

2012-03-04 Thread Tom Lane
Alexander Korotkov writes: > On Sun, Mar 4, 2012 at 5:38 AM, Tom Lane wrote: >> 1. I'm still unhappy about the loop that fills the count histogram, >> as I noted earlier today. It at least needs a decent comment and some >> overflow protection, and I'm not entirely convinced that it doesn't have

Re: [HACKERS] Our regex vs. POSIX on "longest match"

2012-03-04 Thread Tom Lane
hubert depesz lubaczewski writes: > I stand on position that mixing greedy and non-greedy operators should > be possible, and that it should work according to POLA - i.e. greedines > of given atom shouldn't be influenced by other atoms. [ shrug... ] That sounds good, but it's pretty much vacuous

Re: [HACKERS] xlog min recovery request ... is past current point ...

2012-03-04 Thread Heikki Linnakangas
On 03.02.2012 18:32, Christophe Pettus wrote: PostgreSQL 9.0.4: While bringing up a streaming replica, and while it is working its way through the WAL segments before connecting to the primary, I see a lot of messages of the form: 2012-02-01 21:26:13.978 PST,,,24448,,4f2a1e61.5f80,54,,2012-02

Re: [HACKERS] review: CHECK FUNCTION statement

2012-03-04 Thread Pavel Stehule
Hello 2012/3/4 Alvaro Herrera : > > Excerpts from Alvaro Herrera's message of sáb mar 03 17:56:23 -0300 2012: >> Excerpts from Alvaro Herrera's message of sáb mar 03 16:54:19 -0300 2012: >> > Excerpts from Pavel Stehule's message of sáb mar 03 02:25:52 -0300 2012: >> >> > > 3. THE ARE NOT CARET -

Re: [HACKERS] autovacuum locks

2012-03-04 Thread Greg Jaskiewicz
On 2 Mar 2012, at 15:28, Robert Haas wrote: > On Fri, Mar 2, 2012 at 6:22 AM, Gregg Jaskiewicz wrote: >> Looking at the system bit more now, it look like 'waiting' states are >> changing for both the query and autovacuum in pg_stat_activity. >> But very slowly. It looks like they both got into t

Re: [HACKERS] Our regex vs. POSIX on "longest match"

2012-03-04 Thread hubert depesz lubaczewski
On Sun, Mar 04, 2012 at 12:34:22PM -0500, Tom Lane wrote: > Well, that's just an arbitrary example. The cases I remember people > complaining about in practice were the other way round: greedy > quantifier followed by non-greedy, and they were unhappy that the > non-greediness was effectively not

Re: [HACKERS] Collect frequency statistics for arrays

2012-03-04 Thread Tom Lane
Alexander Korotkov writes: > On Sun, Mar 4, 2012 at 5:38 AM, Tom Lane wrote: >> 2. The tests in the above-mentioned message show that in most cases >> where mcelem_array_contained_selec falls through to the "rough >> estimate", the resulting rowcount estimate is just 1, ie we are coming >> out wi

Re: [HACKERS] Command Triggers, patch v11

2012-03-04 Thread Dimitri Fontaine
Tom Lane writes: > FWIW, I agree with Thom on this. If we do it as you suggest, I > confidently predict that it will be less than a year before we seriously > regret it. Given all the discussion around this, it's borderline insane > to believe that the set of parameters to be passed to command t

Re: [HACKERS] Patch: improve selectivity estimation for IN/NOT IN

2012-03-04 Thread Tom Lane
Daniele Varrazzo writes: > On Sun, Mar 4, 2012 at 1:44 PM, Euler Taveira de Oliveira > wrote: >> On 04-03-2012 00:20, Daniele Varrazzo wrote: >>> It looks like you have grand plans for array estimation. My patch has >>> a much more modest scope, and I'm hoping it could be applied to >>> currently

Re: [HACKERS] Our regex vs. POSIX on "longest match"

2012-03-04 Thread Tom Lane
Brendan Jurd writes: > On 4 March 2012 17:53, Tom Lane wrote: >> Brendan Jurd writes: >>> I'll admit that this is a pretty obscure point, but we do appear to be >>> in direct violation of POSIX here. >> How so? POSIX doesn't contain any non-greedy constructs. If you use >> only the POSIX-comp

Re: [HACKERS] RFC: Making TRUNCATE more "MVCC-safe"

2012-03-04 Thread Simon Riggs
On Sun, Mar 4, 2012 at 1:02 PM, Simon Riggs wrote: > On Sun, Mar 4, 2012 at 9:59 AM, Simon Riggs wrote: >> On Sun, Mar 4, 2012 at 2:28 AM, Marti Raudsepp wrote: >>> On Sat, Mar 3, 2012 at 14:53, Simon Riggs wrote: Thanks Noah for drawing attention to this thread. I hadn't been watchin

Re: [HACKERS] ECPG FETCH readahead

2012-03-04 Thread Boszormenyi Zoltan
2012-03-04 17:16 keltezéssel, Michael Meskes írta: > On Fri, Mar 02, 2012 at 11:41:05AM -0500, Noah Misch wrote: >> We yet lack a consensus on whether native ECPG apps should have access to the >> feature. My 2c is to make it available, because it's useful syntactic sugar. >> If your program indep

Re: [HACKERS] ECPG FETCH readahead

2012-03-04 Thread Michael Meskes
On Fri, Mar 02, 2012 at 11:41:05AM -0500, Noah Misch wrote: > We yet lack a consensus on whether native ECPG apps should have access to the > feature. My 2c is to make it available, because it's useful syntactic sugar. > If your program independently processes each row of an arbitrary-length resul

Re: [HACKERS] Patch review for logging hooks (CF 2012-01)

2012-03-04 Thread Andrew Dunstan
On 01/20/2012 10:01 AM, Robert Haas wrote: On Fri, Jan 20, 2012 at 2:47 AM, Greg Smith wrote: The updated patch looks good, marking as 'Ready for Committer' Patches without documentation are never ready for commit. For this one, I'm not sure if that should be in the form of a reference exam

Re: [HACKERS] ECPG FETCH readahead

2012-03-04 Thread Boszormenyi Zoltan
Hi, first, thank you for answering and for the review. 2012-03-02 17:41 keltezéssel, Noah Misch írta: > On Thu, Dec 29, 2011 at 10:46:23AM +0100, Boszormenyi Zoltan wrote: >> 2011-11-16 20:51 keltez?ssel, Boszormenyi Zoltan ?rta: >>> 2010-10-14 11:56 keltez?ssel, Boszormenyi Zoltan ?rta: > On

Re: [HACKERS] Patch: improve selectivity estimation for IN/NOT IN

2012-03-04 Thread Daniele Varrazzo
On Sun, Mar 4, 2012 at 1:44 PM, Euler Taveira de Oliveira wrote: > On 04-03-2012 00:20, Daniele Varrazzo wrote: >> It looks like you have grand plans for array estimation. My patch has >> a much more modest scope, and I'm hoping it could be applied to >> currently maintained PG versions, as I cons

Re: [HACKERS] Collect frequency statistics for arrays

2012-03-04 Thread Alexander Korotkov
On Sun, Mar 4, 2012 at 5:38 AM, Tom Lane wrote: > 2. The tests in the above-mentioned message show that in most cases > where mcelem_array_contained_selec falls through to the "rough > estimate", the resulting rowcount estimate is just 1, ie we are coming > out with very small selectivities. Alt

Re: [HACKERS] Patch: improve selectivity estimation for IN/NOT IN

2012-03-04 Thread Euler Taveira de Oliveira
On 04-03-2012 00:20, Daniele Varrazzo wrote: > It looks like you have grand plans for array estimation. My patch has > a much more modest scope, and I'm hoping it could be applied to > currently maintained PG versions, as I consider the currently produced > estimations a bug. > We don't normally a

Re: [HACKERS] Collect frequency statistics for arrays

2012-03-04 Thread Alexander Korotkov
On Sun, Mar 4, 2012 at 5:38 AM, Tom Lane wrote: > 1. I'm still unhappy about the loop that fills the count histogram, > as I noted earlier today. It at least needs a decent comment and some > overflow protection, and I'm not entirely convinced that it doesn't have > more bugs than the overflow i

Re: [HACKERS] RFC: Making TRUNCATE more "MVCC-safe"

2012-03-04 Thread Simon Riggs
On Sun, Mar 4, 2012 at 9:59 AM, Simon Riggs wrote: > On Sun, Mar 4, 2012 at 2:28 AM, Marti Raudsepp wrote: >> On Sat, Mar 3, 2012 at 14:53, Simon Riggs wrote: >>> Thanks Noah for drawing attention to this thread. I hadn't been >>> watching. As you say, this work would allow me to freeze rows at

Re: [HACKERS] Our regex vs. POSIX on "longest match"

2012-03-04 Thread Brendan Jurd
On 4 March 2012 17:53, Tom Lane wrote: > Brendan Jurd writes: >> I'll admit that this is a pretty obscure point, but we do appear to be >> in direct violation of POSIX here. > > How so?  POSIX doesn't contain any non-greedy constructs.  If you use > only the POSIX-compatible greedy constructs, th

Re: [HACKERS] xlog location arithmetic

2012-03-04 Thread Magnus Hagander
On Tue, Feb 28, 2012 at 07:21, Fujii Masao wrote: > On Sun, Feb 26, 2012 at 8:53 AM, Euler Taveira de Oliveira > wrote: >> On 25-02-2012 09:23, Magnus Hagander wrote: >>> Do we even *need* the validate_xlog_location() function? If we just >>> remove those calls, won't we still catch all the incor

Re: [HACKERS] xlog location arithmetic

2012-03-04 Thread Magnus Hagander
On Sun, Feb 26, 2012 at 00:53, Euler Taveira de Oliveira wrote: > On 25-02-2012 09:23, Magnus Hagander wrote: >> Do we even *need* the validate_xlog_location() function? If we just >> remove those calls, won't we still catch all the incorrectly formatted >> ones in the errors of the sscanf() calls

Re: [HACKERS] RFC: Making TRUNCATE more "MVCC-safe"

2012-03-04 Thread Simon Riggs
On Sun, Mar 4, 2012 at 2:28 AM, Marti Raudsepp wrote: > On Sat, Mar 3, 2012 at 14:53, Simon Riggs wrote: >> Thanks Noah for drawing attention to this thread. I hadn't been >> watching. As you say, this work would allow me to freeze rows at load >> time and avoid the overhead of hint bit setting,