Re: [HACKERS] minor bug...

From: Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Don Baccus <dhogaza(at)pacifier(dot)com>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] minor bug...
Date: 2000-02-09 17:53:06
Message-ID: 38A1A982.AF81E207@alumni.caltech.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> > ... there's no real reason not to support indexes on booleans, is
> > there?

afaict the only case where this would be a win is if there is a *very*
skewed distribution of boolean values, and you *only* want the
uncommon one. Otherwise, looking up half the rows in a table via index
has got to be worse than just scanning the table.

> Not that I can see. Care to whip up the index support? I think the
> only actual new code needed is a three-way-compare function (return -1,
> 0, or +1 according as a < b, a = b, a > b). Then you need to make up
> the appropriate rows in pg_amop and related tables. See the "xindex"
> chapter of the documentation.
> (It occurs to me that performance would probably suck, however, because
> btree doesn't handle lots of equal keys very efficiently. Fixing that
> is on the TODO list...)

... And performance will suck anyway (see above) :)

- Thomas

--
Thomas Lockhart lockhart(at)alumni(dot)caltech(dot)edu
South Pasadena, California

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2000-02-09 20:09:02 Re: [HACKERS] Bug in cursors??
Previous Message Bruce Momjian 2000-02-09 16:19:06 Re: Small update for WinNT port