RE: AW: partial index

Поиск
Список
Период
Сортировка
От Zeugswetter Andreas SB SD
Тема RE: AW: partial index
Дата
Msg-id 46C15C39FEB2C44BA555E356FBCD6FA41EB370@m0114.s-mxs.net
обсуждение исходный текст
Ответ на AW: partial index  ("Zeugswetter Andreas SB SD" <ZeugswetterA@spardat.at>)
Ответы Re: AW: partial index  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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=1and 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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Question about todo item
Следующее
От: Tom Lane
Дата:
Сообщение: Re: AW: partial index