Marc Mamin wrote:
> - BRIN cost: I've made a silly test, where all distinct values exist in all BRIN page ranges:
>
> INSERT into tbrin_1 (cat_id, ....) SELECT s%20, ... FROM generate_series(1,3000000 )s;
> CREATE INDEX cat_brin_1 on tbrin_1 using BRIN (cat_id)with (pages_per_range=64);
> SELECT * from tbrin_1 WHERE cat_id=10;
> http://explain.depesz.com/s/9YQR
>
> There seems to be no "fence" against useless BRIN indexes that would allow a fallback on a table scan.
> But the time overhead remind small :)
Hmm, I guess the costing function for brin could stand some improvement.
Clearly we're not covering all bases.
--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services