| От | Ron Arts |
|---|---|
| Тема | partial indexed not being used. |
| Дата | |
| Msg-id | 45CFB371.8020805@neonova.nl обсуждение исходный текст |
| Ответы |
Re: partial indexed not being used.
|
| Список | pgsql-novice |
Hello
I have a table that has a boolean column telling if that particular
record has been billed already. So most of the time that column holds
only true values.
To select the unbilled record I use the following query:
# select * where billed = false order by calldate;
and defined the following index:
# Create index cdr_billed_index on cdr (billed) where billed = false;
This query took surprisingly long, and explain seems to be telling
me the query is using a sequential scan:
=# explain select cdr.* from cdr where billed = false order by calldate;
QUERY PLAN
-------------------------------------------------------------------
Sort (cost=37448.75..37526.94 rows=31273 width=465)
Sort Key: calldate
-> Seq Scan on cdr (cost=0.00..20323.81 rows=31273 width=465)
Filter: (billed = false)
How can I ensure the patial billing index will be used?
thanks for any insights,
Ron
В списке pgsql-novice по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера