Re: [GENERAL] Are there performance advantages in storing bulky field in separate table?

2009-04-09 Thread Richard Huxton
Ivan Sergio Borgonovo wrote: On Wed, 8 Apr 2009 17:39:02 +0100 Sam Mason s...@samason.me.uk wrote: who num mails of total Tom Lane 1,9358.0% Scott Marlowe 1,0774.5% Alvaro Herrera 5212.2% Joshua Drake4681.9%

Re: [GENERAL] Are there performance advantages in storing bulky field in separate table?

2009-04-09 Thread Robert Treat
On Wednesday 08 April 2009 18:25:25 Ron Mayer wrote: Robert Treat wrote: You can be sure that discussion of this topic in this forum will soon be visited by religious zealots, but the short answer is nulls are bad, mmkay. A slightly longer answer would be that, as a general rule,

Re: [GENERAL] Are there performance advantages in storing bulky field in separate table?

2009-04-09 Thread Grzegorz Jaśkiewicz
If I may, I got an instance once, where table with bytea field was pretty slow. Turned out, that queries modified everything apart from bytea bit. moving it to separate table actually helped performance. But that only will happen providing that you have the bytea/text/whatever that won't change,

[GENERAL] Are there performance advantages in storing bulky field in separate table?

2009-04-08 Thread Ian Mayo
Hi all, I'm designing a Postgresql database, and would appreciate this design advice. I've got a fairly straightforward table that's similar to a blog table (entryId, date, title, author, etc). There is, however, the requirement to allow a single, fairly bulky binary attachment to around 1% of

Re: [GENERAL] Are there performance advantages in storing bulky field in separate table?

2009-04-08 Thread Tom Lane
Ian Mayo ianm...@tesco.net writes: I've got a fairly straightforward table that's similar to a blog table (entryId, date, title, author, etc). There is, however, the requirement to allow a single, fairly bulky binary attachment to around 1% of the rows. There will be a few million rows, and

Re: [GENERAL] Are there performance advantages in storing bulky field in separate table?

2009-04-08 Thread Ian Mayo
Cheers Tom, On Wed, Apr 8, 2009 at 4:47 PM, Tom Lane t...@sss.pgh.pa.us wrote: Ian Mayo ianm...@tesco.net writes: [snip] No.  You'd basically be manually reinventing the TOAST mechanism; or the large object mechanism, if you choose to store the blob as a large object rather than a plain

Re: [GENERAL] Are there performance advantages in storing bulky field in separate table?

2009-04-08 Thread Sam Mason
On Wed, Apr 08, 2009 at 04:56:35PM +0100, Ian Mayo wrote: One more thing: hey, did you hear? I just got some advice from Tom Lane! Statistically speaking; he's the person most likely to answer you by quite a long way. Out of the ~24k emails going back to Oct 2007 I've got from pgsql-general

Re: [GENERAL] Are there performance advantages in storing bulky field in separate table?

2009-04-08 Thread Ivan Sergio Borgonovo
On Wed, 8 Apr 2009 17:39:02 +0100 Sam Mason s...@samason.me.uk wrote: On Wed, Apr 08, 2009 at 04:56:35PM +0100, Ian Mayo wrote: One more thing: hey, did you hear? I just got some advice from Tom Lane! Statistically speaking; he's the person most likely to answer you by quite a long

Re: [GENERAL] Are there performance advantages in storing bulky field in separate table?

2009-04-08 Thread Robert Treat
On Wednesday 08 April 2009 11:56:35 Ian Mayo wrote: Cheers Tom, On Wed, Apr 8, 2009 at 4:47 PM, Tom Lane t...@sss.pgh.pa.us wrote: Ian Mayo ianm...@tesco.net writes: [snip] No.  You'd basically be manually reinventing the TOAST mechanism; or the large object mechanism, if you choose

Re: [GENERAL] Are there performance advantages in storing bulky field in separate table?

2009-04-08 Thread Ian Mayo
On Wed, Apr 8, 2009 at 8:13 PM, Robert Treat xzi...@users.sourceforge.net wrote: Maybe I've been reading too much Pascal again lately, but if only 1% of your rows are going to have data in this column, personally, I'd put it in a separate table. thanks for that Robert - it does match my

Re: [GENERAL] Are there performance advantages in storing bulky field in separate table?

2009-04-08 Thread Ron Mayer
Sam Mason wrote: On Wed, Apr 08, 2009 at 04:56:35PM +0100, Ian Mayo wrote: One more thing: hey, did you hear? I just got some advice from Tom Lane! Statistically speaking; he's the person most likely to answer you by Even so, this might be the #1 advantage of Postgres over Oracle (cost

Re: [GENERAL] Are there performance advantages in storing bulky field in separate table?

2009-04-08 Thread Chris Browne
ianm...@tesco.net (Ian Mayo) writes: On Wed, Apr 8, 2009 at 8:13 PM, Robert Treat xzi...@users.sourceforge.net wrote: Maybe I've been reading too much Pascal again lately, but if only 1% of your rows are going to have data in this column, personally, I'd put it in a separate table. thanks

Re: [GENERAL] Are there performance advantages in storing bulky field in separate table?

2009-04-08 Thread Robert Treat
On Wednesday 08 April 2009 15:30:28 Ian Mayo wrote: On Wed, Apr 8, 2009 at 8:13 PM, Robert Treat xzi...@users.sourceforge.net wrote: Maybe I've been reading too much Pascal again lately, but if only 1% of your rows are going to have data in this column, personally, I'd put it in a

Re: [GENERAL] Are there performance advantages in storing bulky field in separate table?

2009-04-08 Thread Sam Mason
On Wed, Apr 08, 2009 at 05:06:44PM -0400, Robert Treat wrote: A slightly longer answer would be that, as a general rule, attributes of your relations that only apply to 1% of the rows are better represented as a one to N relationship using a second table. Have you tried to

Re: [GENERAL] Are there performance advantages in storing bulky field in separate table?

2009-04-08 Thread Ron Mayer
Robert Treat wrote: You can be sure that discussion of this topic in this forum will soon be visited by religious zealots, but the short answer is nulls are bad, mmkay. A slightly longer answer would be that, as a general rule, attributes of your relations that only apply to 1% of the

Re: [GENERAL] Are there performance advantages in storing bulky field in separate table?

2009-04-08 Thread Leif B. Kristensen
On Wednesday 8. April 2009, Ron Mayer wrote: Sam Mason wrote: On Wed, Apr 08, 2009 at 04:56:35PM +0100, Ian Mayo wrote: One more thing: hey, did you hear? I just got some advice from Tom Lane! Statistically speaking; he's the person most likely to answer you by Even so, this might be the