Re: [HACKERS] Problem with complex query

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: phd2(at)earthling(dot)net
Cc: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: [HACKERS] Problem with complex query
Date: 1999-02-24 15:25:54
Message-ID: 14262.919869954@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Oleg Broytmann <phd(at)sun(dot)med(dot)ru> writes:
> SELECT DISTINCT p.subsec_id
> FROM central cn, shops sh, districts d, positions p
> WHERE cn.shop_id = sh.shop_id AND sh.distr_id = d.distr_id
> AND d.city_id = %d AND cn.pos_id = p.pos_id
> AND cn.date_i >= current_date - '7 days'::timespan
> While running postgres slowly eats all swap space (30 Meg) and aborts:
> pqReadData() -- backend closed the channel unexpectedly.
> Is it I just have not enough memory or bug?

What version are you running? Also, does it act the same if you try to
EXPLAIN that same query? If EXPLAIN fails then the problem is in the
plan/optimize stage, not actual execution of the query.

This kinda sounds like the optimizer problems that Bruce has fixed for
6.5, but I don't recall anyone reporting serious problems with only
4 tables in the query --- you had to get up to 7 or 8 or so before
it really went nuts.

regards, tom lane

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Vince Vielhaber 1999-02-24 15:28:48 Re: [HACKERS] VACUUM ANALYZE problem on linux
Previous Message Todd Graham Lewis 1999-02-24 15:09:35 Re: [HACKERS] RE: [GENERAL] Transaction logging