From: | "Zeugswetter Andreas SB SD" <ZeugswetterA(at)spardat(dot)at> |
---|---|
To: | "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | "Tatsuo Ishii" <t-ishii(at)sra(dot)co(dot)jp>, <pgsql-hackers(at)postgresql(dot)org> |
Subject: | RE: AW: partial index |
Date: | 2001-08-06 15:05:13 |
Message-ID: | 46C15C39FEB2C44BA555E356FBCD6FA41EB370@m0114.s-mxs.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
> > test=# create index myindex on accounts(aid) where bid <> 0;
>
> > Hmm ? Am I reading correctly ? a restriction that is on a field,
that
> > is not in the index ? Does that make sense ?
>
> Yes it does, and in fact it's one of the more important applications
of
> partial indexes. It's the only way that a partial index can be
cheaper
> to scan than a full index.
Ok, yes, sounds great, but then back to Tatsuo's question:
Why is the index atestpartial not used (instead DEBUG) ?
create table atest (aid int, bid int);
create index atestpartial on atest (aid) where bid <> 0;
select * from atest where aid=1 and bid <> 0;
and instead seq scan for 1 mio rows 2 rows where bid <> 0
Since bid is not in an index the evaluation of usability obviously
should not be based on index ops ?
Andreas
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2001-08-06 15:25:58 | Re: AW: partial index |
Previous Message | Tom Lane | 2001-08-06 14:53:20 | Re: Question about todo item |