"Dean Gibson (DB Administrator)" <postgresql4@xxxxxxxxxxxx> writes: > The following query ran in a fraction of a second on 7.4.8: > ... > On 8.0.4, it runs for hours (stopped after two hours). Here's the plan: Do you have the plan used by 7.4? BTW, this is not really on-topic for pgsql-general; pgsql-perform would be a more appropriate forum. regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 6: explain analyze is your friend