"andremachado" <andremachado@xxxxxxxxxxxxxxxx> writes: > Firebird has something similiar to EXPLAIN. Please look below. Hm, maybe I just don't know how to read their output, but it's not obvious to me where they are doing the min/max aggregates. > Is there something really wrong with the postgresql configuration (at my > previous msg) that is causing this poor performance at these 2 queries? I don't think it's a configuration issue, it's a quality-of-plan issue. Could you put together a self-contained test case for this problem? I don't have the time or interest to try to reverse-engineer tables and test data for these queries --- but I would be interested in finding out where the time is going, if I could run the queries. regards, tom lane