Re: Functional dependencies and GROUP BY

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Functional dependencies and GROUP BY
Дата
Msg-id 4557.1281149492@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Functional dependencies and GROUP BY  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re: Functional dependencies and GROUP BY  (Dean Rasheed <dean.a.rasheed@gmail.com>)
Список pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
> Next version.  Changed dependencies to pg_constraint, removed handling
> of unique constraints for now, and made some enhancements so that views
> track dependencies on constraints even in subqueries.  Should be close
> to final now. :-)

I've committed this with some revisions, notably:

The view.c changes were fundamentally wrong.  The right place to
extract dependencies from a parsetree is in dependency.c, specifically
find_expr_references_walker.  The way you were doing it meant that
dependencies on constraints would only be noticed for views, not for
other cases such as stored plans.

I rewrote the catalog search to look only at pg_constraint, not using
pg_index at all.  I think this will be easier to extend to the case of
looking for UNIQUE + NOT NULL, whenever we get around to doing that.
I also moved the search into catalog/pg_constraint.c, because it didn't
seem to belong in parse_agg (as hinted by the large number of #include
additions you had to make to put it there).

I put in a bit of caching logic to prevent repeating the search for
multiple Vars of the same relation.  Tests or no tests, I can't believe
that's going to be cheap enough that we want to repeat it over and
over...
        regards, tom lane


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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Surprising dead_tuple_count from pgstattuple
Следующее
От: KaiGai Kohei
Дата:
Сообщение: Re: refactoring comment.c