pgsql: When we have successfully optimized a MIN or MAX aggregate into

Поиск
Список
Период
Сортировка
От tgl@postgresql.org (Tom Lane)
Тема pgsql: When we have successfully optimized a MIN or MAX aggregate into
Дата
Msg-id 20080327190615.1E4087558E7@cvs.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Log Message:
-----------
When we have successfully optimized a MIN or MAX aggregate into an indexscan,
the query result must be exactly one row (since we don't do this when there's
any GROUP BY).  Therefore any ORDER BY or DISTINCT attached to the query is
useless and can be dropped.  Aside from saving useless cycles, this protects
us against problems with matching the hacked-up tlist entries to sort clauses,
as seen in a bug report from Taiki Yamaguchi.  We might need to work harder
if we ever try to optimize grouped queries with this approach, but this
solution will do for now.

Modified Files:
--------------
    pgsql/src/backend/optimizer/plan:
        planner.c (r1.227 -> r1.228)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/plan/planner.c?r1=1.227&r2=1.228)

В списке pgsql-committers по дате отправления:

Предыдущее
От: momjian@postgresql.org (Bruce Momjian)
Дата:
Сообщение: pgsql: Remove ipcclean utility command --- didn't work on all Unixes and
Следующее
От: tgl@postgresql.org (Tom Lane)
Дата:
Сообщение: pgsql: When we have successfully optimized a MIN or MAX aggregate into