Skip site navigation (1) Skip section navigation (2)

Re: number of rows estimation for bit-AND operation

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: Slava Moudry <smoudry(at)4info(dot)net>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: number of rows estimation for bit-AND operation
Date: 2009-08-21 01:32:02
Message-ID: dcc563d10908201832u85305ebg93d014e355a34f@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-performance
2009/8/20 Slava Moudry <smoudry(at)4info(dot)net>:
> 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 created two test tables, one with a single int, one with
8 bools, and put 100M entries in each.  The table with 8 bools took up
aprrox. 3560616 bytes, while the one with a single int took up approx.
3544212

I.e they're about the same.  You should really test to see if having a
lot of bools costs more than mangling ints around.  I'm guessing I
could fit a lot more bools in the test table due to alignment issues
than just 8.

In response to

Responses

pgsql-performance by date

Next:From: Scott CareyDate: 2009-08-21 01:33:56
Subject: Re: improving my query plan
Previous:From: ChrisDate: 2009-08-21 01:21:45
Subject: Re: improving my query plan

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group