| From: | Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com> |
|---|---|
| To: | Gregory Stark <stark(at)enterprisedb(dot)com> |
| Cc: | Mohamed <mohamed5432154321(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org |
| Subject: | Re: Indices types, what to use. Btree, Hash, Gin or Gist |
| Date: | 2009-02-01 01:11:58 |
| Message-ID: | dcc563d10901311711q8b80ec5ieb5fbc464fd4ee19@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
On Sat, Jan 31, 2009 at 1:33 PM, Gregory Stark <stark(at)enterprisedb(dot)com> wrote:
> No index is going to be particularly effective for boolean columns unless
> they're very heavily skewed. You might find it useful to build separate
> partial indexes on other keys for each value though.
Not entirely true. If you've got a table where <1% of the rows are
one or the other, a partial index can be very useful on a bool.
Also, in the very odd case where you almost all the time select all
the true or all the false, a regular index can be useful for
reindexing the table on.
But yeah, if there's a relatively even mix of true and false, then a
bool index isn't much use.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Jasen Betts | 2009-02-01 02:35:39 | Re: how to implement a foreign key type constraint against a not unique column |
| Previous Message | Milen A. Radev | 2009-02-01 00:59:35 | Re: [GENERAL] Encoding problem using pg_dumpall |