Re: [PATCHES] [HACKERS] TRUNCATE TABLE with IDENTITY

2008-06-08 Thread Tom Lane
Alvaro Herrera [EMAIL PROTECTED] writes: Tom Lane wrote: 2. I had first dismissed Neil's idea of transactional sequence updates as impossible, but on second look it could be done. Suppose RESTART IDENTITY does this for each sequence; * obtain AccessExclusiveLock; * assign a new

[HACKERS] Proposal - improve eqsel estimates by including histogram bucket numdistinct statistics

2008-06-08 Thread Nathan Boley
Currently eqsel assumes that, except for the values stored as mcv's, the number of times that a value appears in a table column is independent of it's value. Unfortunately, this often yields inappropriate selectivity estimates and frequently leads to inappropriate plans. As an example, consider

Re: [HACKERS] Proposal - improve eqsel estimates by including histogram bucket numdistinct statistics

2008-06-08 Thread Tom Lane
Nathan Boley [EMAIL PROTECTED] writes: ... There are two potential problems that I see with this approach: 1) It assumes the = is equivalent to = and = . This is certainly true for real numbers, but is it true for every equality relation that eqsel predicts for? The cases that

[HACKERS] handling TOAST tables in autovacuum

2008-06-08 Thread Alvaro Herrera
Hi, We've been making noises about dealing with TOAST tables as separate entities in autovacuum for some time now. So here's a proposal: Let's do it. That's about it :-) The only change of some consideration is that we will need two passes over pg_class to get the list of relations to vacuum,

Re: [HACKERS] math error or rounding problem Money type

2008-06-08 Thread Gregory Stark
Mark Kirkwood [EMAIL PROTECTED] writes: IFAIK (dimly recalling numerical analysis courses at university) SUM and ROUND can *never* be commuted. In general the recommended approach is to round as late as possible and as few times are possible - so your 1st query is the correct or best way to

Re: [HACKERS] Overhauling GUCS

2008-06-08 Thread Gregory Stark
Joshua D. Drake [EMAIL PROTECTED] writes: On Fri, 2008-06-06 at 20:19 -0400, Tom Lane wrote: Robert Treat [EMAIL PROTECTED] writes: Actually, the reason it's still 10 is that the effort expended to get it changed has been *ZERO*. I keep asking for someone to make some measurements, do some

Re: [HACKERS] handling TOAST tables in autovacuum

2008-06-08 Thread Tom Lane
Alvaro Herrera [EMAIL PROTECTED] writes: The only change of some consideration is that we will need two passes over pg_class to get the list of relations to vacuum, instead of one as we do currently. The problem is that we first need to fetch the (heap relid, toast relid) mapping before

Re: [HACKERS] pg_dump restore time and Foreign Keys

2008-06-08 Thread Robert Treat
On Saturday 07 June 2008 16:22:56 Tom Lane wrote: Simon Riggs [EMAIL PROTECTED] writes: Perhaps we need a GUC that says expert_mode = on. ... Another idea might be to make such command options superuser only, to ensure the power is available, yet only in the hands of, by-definition, the

Re: [HACKERS] Overhauling GUCS

2008-06-08 Thread Robert Treat
On Sunday 08 June 2008 19:07:21 Gregory Stark wrote: Joshua D. Drake [EMAIL PROTECTED] writes: On Fri, 2008-06-06 at 20:19 -0400, Tom Lane wrote: Robert Treat [EMAIL PROTECTED] writes: Actually, the reason it's still 10 is that the effort expended to get it changed has been *ZERO*. I

[HACKERS] libpq support for arrays and composites

2008-06-08 Thread Andrew Dunstan
One of the areas where libpq seems to be severely lacking is in handling arrays and composites in query results. I'd like to set about rectifying that. Ideally this would mean that drivers using libpq could easily and reliably deliver such objects suitably structured in their particular

Re: [HACKERS] libpq support for arrays and composites

2008-06-08 Thread Tom Lane
Andrew Dunstan [EMAIL PROTECTED] writes: One complicating factor I see is that there is no protocol level support for anything other than simple objects - each data value is simply a stream of bytes of a known length. We would therefore need some pretty robust processing to pick apart

Re: [HACKERS] pg_dump restore time and Foreign Keys

2008-06-08 Thread Tom Lane
Robert Treat [EMAIL PROTECTED] writes: and i'm sure no one is against that idea, but you're never going to be able to match the performance of just avoiding the check. We'll never be able to match the performance of not having transactions, either, but the community has never for a moment

Re: [HACKERS] handling TOAST tables in autovacuum

2008-06-08 Thread Alvaro Herrera
Tom Lane wrote: Alvaro Herrera [EMAIL PROTECTED] writes: The only change of some consideration is that we will need two passes over pg_class to get the list of relations to vacuum, instead of one as we do currently. The problem is that we first need to fetch the (heap relid, toast relid)

Re: [HACKERS] handling TOAST tables in autovacuum

2008-06-08 Thread Tom Lane
Alvaro Herrera [EMAIL PROTECTED] writes: The point here is that if the user disables autovac for the main table, then it's expected that it is automagically disabled for the toast table as well, for the usual case where they are disabling it because the table is too big. Hmm, good point. OK,

Re: [HACKERS] libpq support for arrays and composites

2008-06-08 Thread Andrew Dunstan
Tom Lane wrote: Andrew Dunstan [EMAIL PROTECTED] writes: One complicating factor I see is that there is no protocol level support for anything other than simple objects - each data value is simply a stream of bytes of a known length. We would therefore need some pretty robust processing

Re: [HACKERS] pg_dump restore time and Foreign Keys

2008-06-08 Thread Robert Treat
On Sunday 08 June 2008 20:12:15 Tom Lane wrote: Robert Treat [EMAIL PROTECTED] writes: and i'm sure no one is against that idea, but you're never going to be able to match the performance of just avoiding the check. We'll never be able to match the performance of not having transactions,

[HACKERS] Automating our version-stamping a bit better

2008-06-08 Thread Tom Lane
So while tagging the upcoming releases, I got annoyed once again about what a tedious, error-prone bit of donkeywork it is. You've got to find and update the sub-version numbers, and *not* any chance occurrence of the same strings (eg s/20/21/g for version 7.4.21 would've mangled some copyright

Re: [HACKERS] Automating our version-stamping a bit better

2008-06-08 Thread Andrew Dunstan
Tom Lane wrote: I'm tempted to suggest letting the script invoke autoconf, too, but that would require standardizing where to find the correct version of autoconf for each branch; so it might not be such a great idea. Unfortunately that's true. Maybe we could agree on using an

Re: [HACKERS] Automating our version-stamping a bit better

2008-06-08 Thread Tom Lane
Andrew Dunstan [EMAIL PROTECTED] writes: Tom Lane wrote: I'm tempted to suggest letting the script invoke autoconf, too, but that would require standardizing where to find the correct version of autoconf for each branch; so it might not be such a great idea. Unfortunately that's true.

Re: [HACKERS] handling TOAST tables in autovacuum

2008-06-08 Thread Euler Taveira de Oliveira
Alvaro Herrera wrote: We've been making noises about dealing with TOAST tables as separate entities in autovacuum for some time now. So here's a proposal: Let's keep it simple. Why not just adding a toast_enabled flag (disabled by default) in pg_autovacuum? If it's set then main and toast

Re: [CORE] [HACKERS] Automating our version-stamping a bit better

2008-06-08 Thread Marc G. Fournier
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 - --On Sunday, June 08, 2008 21:27:03 -0400 Tom Lane [EMAIL PROTECTED] wrote: Andrew Dunstan [EMAIL PROTECTED] writes: Tom Lane wrote: I'm tempted to suggest letting the script invoke autoconf, too, but that would require standardizing where to

Re: [HACKERS] handling TOAST tables in autovacuum

2008-06-08 Thread Alvaro Herrera
Euler Taveira de Oliveira wrote: FYI, I have a WIP patch to remove pg_autovacuum in favor of reloptions. Really? Please send it my way to review/apply as soon as you have it ready, independently of what we do with toast tables. Let's keep it simple. Why not just adding a toast_enabled flag

Re: [HACKERS] libpq support for arrays and composites

2008-06-08 Thread Andrew Chernow
Andrew Dunstan wrote: One of the areas where libpq seems to be severely lacking is in handling arrays and composites in query results. I'd like to set about rectifying that. Ideally this would mean that drivers using libpq could easily and reliably deliver such objects suitably structured

Re: [HACKERS] handling TOAST tables in autovacuum

2008-06-08 Thread Tom Lane
Alvaro Herrera [EMAIL PROTECTED] writes: Euler Taveira de Oliveira wrote: And based on your proposal, it'll be needed to add reloptions to toast tables too. IMO, we should keep that code as simple as possible. Sure, what's the problem with that? We only need to make sure that ALTER TABLE