possible optimizations - pushing filter before aggregation

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: possible optimizations - pushing filter before aggregation
Date: 2016-11-18 08:46:20
Message-ID: CAFj8pRAaL=j259JFSbCkVKcXzUJW0h1rNLjw0aOSgvta-B=zaw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi

In one application I see slow queries. There is often used views like

CREATE VIEW v AS SELECT min(a) M1, min(b) M2, max(c) M3, x, y, z
FROM t1 GROUP BY x, y, z;

and queries like

SELECT * FROM v
WHERE M2 = const1
AND M3 > const2

Isn't possible in this case push equivalence before aggregation?

Regards

Pavel

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dave Page 2016-11-18 09:00:07 Re: Mail thread references in commits
Previous Message Craig Ringer 2016-11-18 08:18:15 Re: PATCH: Batch/pipelining support for libpq