Re: [PERFORM] Why is the optimiser choosing the slower query, or, understanding explain analyze output

2014-02-17 Thread Alistair Bayley
On 18 February 2014 14:40, Tom Lane wrote: > I notice though that the cost estimate for the seqscan plan isn't all that > much lower than that for the indexscan plan. Probably lowering > random_page_cost a bit would change the planner's mind. We have no > information about total size of database

[PERFORM] Why is the optimiser choosing the slower query, or, understanding explain analyze output

2014-02-17 Thread Alistair Bayley
I have postgresql 8.4.15 on Ubuntu 10.04 and this query: SELECT MAX(probeTable.PROBE_ALARM_EVENT_ID) AS MAX_EVENT_ID FROM ALARM_EVENT eventTable INNER JOIN ALARM_EVENT_PROBE probeTable ON eventTable.ALARM_EVENT_ID = probeTable.ALARM_EVENT_ID WHERE probeTable.PROBE_ID = 2 wh