Re: [PERFORM] Basic Q on superfluous primary keys

2007-04-16 Thread Merlin Moncure
On 4/14/07, Bill Moran [EMAIL PROTECTED] wrote: In response to Kynn Jones [EMAIL PROTECTED]: The two situations are semantically identical: each record in table bar refers to a record in table foo. The difference is that in the first schema, this referencing is done through an artificial

Re: [PERFORM] Basic Q on superfluous primary keys

2007-04-16 Thread Craig A. James
Merlin Moncure wrote: Using surrogate keys is dangerous and can lead to very bad design habits that are unfortunately so prevalent in the software industry they are virtually taught in schools. ... While there is nothing wrong with them in principle (you are exchanging one key for another as a

Re: [PERFORM] Basic Q on superfluous primary keys

2007-04-16 Thread Merlin Moncure
On 4/16/07, Craig A. James [EMAIL PROTECTED] wrote: Merlin Moncure wrote: Using surrogate keys is dangerous and can lead to very bad design habits that are unfortunately so prevalent in the software industry they are virtually taught in schools. ... While there is nothing wrong with them

Re: [PERFORM] Basic Q on superfluous primary keys

2007-04-16 Thread Ron Mayer
Craig A. James wrote: Merlin Moncure wrote: Using surrogate keys is dangerous and can lead to very bad design habits that are unfortunately so prevalent in the software industry they are virtually taught in schools. ... While there is nothing wrong with them in principle (you are exchanging

Re: [PERFORM] FK triggers misused?

2007-04-16 Thread cluster
So the next question is, what pg version is the original poster using? because 8.1.x doesn't report trigger execution times, and 8.2.x would use a single bitmap index scan with an = ANY condition, not a BitmapOr. I have tried 8.1.0 and 8.1.3 for this query. ---(end of

Re: [PERFORM] FK triggers misused?

2007-04-16 Thread Tom Lane
cluster [EMAIL PROTECTED] writes: So the next question is, what pg version is the original poster using? because 8.1.x doesn't report trigger execution times, and 8.2.x would use a single bitmap index scan with an = ANY condition, not a BitmapOr. I have tried 8.1.0 and 8.1.3 for this query.

Re: [PERFORM] FK triggers misused?

2007-04-16 Thread Tom Lane
Idly thumbing through the code, I came across something that might possibly explain your results. Do the rows being updated contain NULLs in the foreign-key columns? I see that ri_KeysEqual() treats two null values as not equal, which might be overzealous respect for SQL null semantics in this

Re: [PERFORM] Basic Q on superfluous primary keys

2007-04-16 Thread Greg Smith
On Mon, 16 Apr 2007, Merlin Moncure wrote: extraordinary cases do happen, like a company overhauling its numbering systems, but such cases can be dealt with by a number of methods including letting RI do its thing. I think the point Craig was trying to make is that what you refer to here as

Fwd: [PERFORM] Strangely Variable Query Performance

2007-04-16 Thread Robins
Hi Tom / Steve, Am one of the silent readers of performance issues that come up on this list (and are discussed in detail) ... just like this one. If and when you do come up with a solution, please do post some details about them here... (i say that coz it seems that for obvious reasons, things

Re: Fwd: [PERFORM] Strangely Variable Query Performance

2007-04-16 Thread Tom Lane
Robins [EMAIL PROTECTED] writes: If and when you do come up with a solution, please do post some details about them here... (i say that coz it seems that for obvious reasons, things must have gone off air after tom's last email, and one can understand that). But an analysis, or atleast a