alternative to bitmap index in postgresql

后端 未结 3 878
野趣味
野趣味 2021-01-19 19:06

I have a table with hundreds of millions rows with schema like below.

tabe AA {
 id integer primay key,
 prop0 boolean not null,
 prop1 boolean not null,
 p         


        
3条回答
  •  无人共我
    2021-01-19 19:55

    An index is only used if it actually speeds up the query which is not necessarily always the case. Especially with smallish tables (say thousands of rows) a full table scan ("seq scan" in the Postgres execution plan) might indeed be a lot faster.

    How many rows did the table have when you tried the statement? How did the query look like? Maybe there are other conditions that prevent the index usage. Did you analyze the table to have up-to-date statistics?

提交回复
热议问题