Why does a simple query not use an obvious index?
От | Jack Kerkhof |
---|---|
Тема | Why does a simple query not use an obvious index? |
Дата | |
Msg-id | ENEIKKAEJOFHOIHMMOIDIEBMJCAA.jack.kerkhof@guest-tek.com обсуждение исходный текст |
Ответы |
Re: Why does a simple query not use an obvious index?
Re: Why does a simple query not use an obvious index? |
Список | pgsql-performance |
The query:
select count(*) from billing where timestamp > now()-60
should obviously use the index CREATE INDEX billing_timestamp_idx ON billing USING btree ("timestamp" timestamp_ops); on a table with 1400000 rows. But it uses a Seq Scan. If I set enable_seqscan=no, it indicates a queryplan could not be calculated. Why does this simple query not use the timestamp index, and how can I get it to? Thanks, Jack
![]() | |
Guest-Tek is a leading provider of broadband technology solutions for the hospitality industry. Guest-Tek's GlobalSuite high-speed Internet solution enables hotels to offer their guests the convenience of wired and/or wireless broadband Internet access from guest rooms, meeting rooms and public areas. |
В списке pgsql-performance по дате отправления: