"John Lister" writes:
Am I right in assuming the planner thinks a sequential scan is quicker
than 10k index hits, would tweaking the costs fix this or would i be
better updating the stats for the product_id and manufacturer_id fields?
AFAICT the planner did exactly the right things here. You
"John Lister" writes:
> Am I right in assuming the planner thinks a sequential scan is quicker than
> 10k index hits, would tweaking the costs fix this or would i be better
> updating the stats for the product_id and manufacturer_id fields?
AFAICT the planner did exactly the right things here.
Doing the following query
select distinct m.id, m.name
from manufacturer_manufacturer m
join product_product p on (p.manufacturer_id=m.id)
join retailer_offer o on (o.product_id=p.id)
where o.retailer_id=XXX and o.active
results in one of 2 query plans depending upon the v