Re: [PERFORM] number of rows estimation for bit-AND operation

2009-08-21 Thread Slava Moudry
t8 can accomodate 64 flags - the space saving can be substantial. Thanks, -Slava. - Original Message - From: "Scott Marlowe" To: "Slava Moudry" Cc: "Robert Haas" ; Sent: Thursday, August 20, 2009 6:58 PM Subject: Re: [PERFORM] number of rows estimation

Re: [PERFORM] number of rows estimation for bit-AND operation

2009-08-21 Thread Alvaro Herrera
Robert Haas escribió: > Scott, did you check whether a toast table got created here and what > the size of it was? A table with only bool columns (and, say, one int8 column) would not have a toast table. Only varlena columns produce toast tables. -- Alvaro Herrera

Re: [PERFORM] number of rows estimation for bit-AND operation

2009-08-21 Thread Robert Haas
On Thu, Aug 20, 2009 at 9:58 PM, Scott Marlowe wrote: > On Thu, Aug 20, 2009 at 7:32 PM, Scott Marlowe wrote: >> 2009/8/20 Slava Moudry : >>> Hi, >>> Yes, I thought about putting the bit-flags in separate fields. >>> Unfortunately - I expect to have quite a lot of these and space is an issue >>> w

Re: [PERFORM] number of rows estimation for bit-AND operation

2009-08-20 Thread Slava Moudry
0:55 AM To: Scott Marlowe Cc: Slava Moudry; pgsql-performance@postgresql.org Subject: Re: [PERFORM] number of rows estimation for bit-AND operation On Tue, Aug 18, 2009 at 6:34 PM, Scott Marlowe wrote: > 2009/8/18 Slava Moudry : >>> increase default stats target, analyze, try again. >&g

Re: [PERFORM] number of rows estimation for bit-AND operation

2009-08-20 Thread Scott Marlowe
On Thu, Aug 20, 2009 at 7:32 PM, Scott Marlowe wrote: > 2009/8/20 Slava Moudry : >> Hi, >> Yes, I thought about putting the bit-flags in separate fields. >> Unfortunately - I expect to have quite a lot of these and space is an issue >> when you are dealing with billions of records in fact table, s

Re: [PERFORM] number of rows estimation for bit-AND operation

2009-08-20 Thread Scott Marlowe
2009/8/20 Slava Moudry : > Hi, > Yes, I thought about putting the bit-flags in separate fields. > Unfortunately - I expect to have quite a lot of these and space is an issue > when you are dealing with billions of records in fact table, so I prefer to > pack them into one int8. For giggles I cre

Re: [PERFORM] number of rows estimation for bit-AND operation

2009-08-20 Thread Robert Haas
On Tue, Aug 18, 2009 at 6:34 PM, Scott Marlowe wrote: > 2009/8/18 Slava Moudry : >>> increase default stats target, analyze, try again. >> This field has only 5 values. I had put values/frequencies in my first post. > > Sorry, kinda missed that.  Anyway, there's no way for pg to know which > operat

Re: [PERFORM] number of rows estimation for bit-AND operation

2009-08-18 Thread Slava Moudry
essage- From: Scott Marlowe [mailto:scott.marl...@gmail.com] Sent: Tuesday, August 18, 2009 2:58 PM To: Slava Moudry Cc: pgsql-performance@postgresql.org Subject: Re: [PERFORM] number of rows estimation for bit-AND operation 2009/8/18 Slava Moudry : > Hi Scott, > Thank you for reply. >

Re: [PERFORM] number of rows estimation for bit-AND operation

2009-08-18 Thread Slava Moudry
Original Message- From: Scott Marlowe [mailto:scott.marl...@gmail.com] Sent: Tuesday, August 18, 2009 12:09 AM To: Slava Moudry Cc: pgsql-performance@postgresql.org Subject: Re: [PERFORM] number of rows estimation for bit-AND operation On Mon, Aug 17, 2009 at 2:07 PM, Slava Moudry wrote: > Hi, > &g

Re: [PERFORM] number of rows estimation for bit-AND operation

2009-08-18 Thread Scott Marlowe
2009/8/18 Slava Moudry : >> increase default stats target, analyze, try again. > This field has only 5 values. I had put values/frequencies in my first post. Sorry, kinda missed that. Anyway, there's no way for pg to know which operation is gonna match. Without an index on it. So my guess is th

Re: [PERFORM] number of rows estimation for bit-AND operation

2009-08-18 Thread Scott Marlowe
2009/8/18 Slava Moudry : > Hi Scott, > Thank you for reply. > I am using Postgres 8.4.0 (btw - great release --very happy about it) and I > got a different plan after following your advice: Yeah, you're returning most of the rows, so a seq scan makes sense. Try indexing / matching on something mo

Re: [PERFORM] number of rows estimation for bit-AND operation

2009-08-18 Thread Scott Marlowe
On Mon, Aug 17, 2009 at 2:07 PM, Slava Moudry wrote: > Hi, > > I am using int8 field to pack a number of error flags. This is very common > technique for large tables to pack multiple flags in one integer field. > > For most records – the mt_flags field is 0. Here is the statistics (taken > from pg

[PERFORM] number of rows estimation for bit-AND operation

2009-08-17 Thread Slava Moudry
Hi, I am using int8 field to pack a number of error flags. This is very common technique for large tables to pack multiple flags in one integer field. For most records - the mt_flags field is 0. Here is the statistics (taken from pgAdmin Statistics tab for mt_flags column): Most common Values: {