I think you may increase the row number that you want to limit, like LIMIT
50.
LIMIT can change the cost of a plan dramatically. Looking in your SQL:
where this_.fkaddressid= 6664161
order by this_.addressvaluationid desc limit 1;
Planner may use either index1(this_.fkaddressid) or
index2(
Tom Lane wrote:
Pallav Kalva <[EMAIL PROTECTED]> writes:
why does it have different plans for different values
Because the values occur different numbers of times (or so it thinks
anyway). If the rowcount estimates are far from reality, perhaps
increasing the statistics target woul
Pallav Kalva <[EMAIL PROTECTED]> writes:
>why does it have different plans for different values
Because the values occur different numbers of times (or so it thinks
anyway). If the rowcount estimates are far from reality, perhaps
increasing the statistics target would help. However, since yo