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

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Partial index causing wrong results to be returned on 8.1.3



I could not duplicate this on any identical database, but thought I
would report it here, just for completeness. I've tried reindexing,
vacuuming, etc. Explain plans all look normal.

Version is 8.1.3
\d bigtable
...
"bigtable_status_partial" btree (status) WHERE status::text <>
'shipped'::text
 
 
greg=> select (select count(*) from bigtable where status  = 'shipped')
            + (select count(*) from bigtable where status <> 'shipped')
       UNION select count(*) from bigtable;
 ?column?
----------
  1185213
  1600569
 
greg=> drop index bigtable_status_partial;
 
greg=> select (select count(*) from bigtable where status  = 'shipped')
            + (select count(*) from bigtable where status <> 'shipped')
       UNION select count(*) from bigtable;
 ?column?
----------
  1185213
(1 row)

--
Greg Sabino Mullane greg(at)turnstep(dot)com
End Point Corporation
PGP Key: 0x14964AC8 200608290003
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8


Attachment: signature.asc
Description: This is a digitally signed message part



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group