2016-08-18 16:56 GMT+03:00 Tom Lane <tgl@xxxxxxxxxxxxx>:
In that case you've got random_page_cost too far down. Values less than
the default of 4 are generally only appropriate if the bulk of your
database stays in RAM.
Oh, that's interesting. I was under impression, that r_p_c reflects IO speed, like — make it smaller for SSDs.
To make this query prefer BitmapScan, I need to bump r_p_c to 5.8. And 6.0 makes it switch to SeqScan.
Does it means, that for huge DB (this one is ~1.5TB) it is better to increase r_p_c?
Still, this effect shows only for partial indexes, i.e. if I disable `idx_loan_agreemnets_loan_
than planner will not use any other and goes straight to SeqScan.
Does it means, that amount of table-related IO is not accounted for when planning scan over partial index?
--
Victor Y. Yegorov