Re: Statistics Import and Export
От | Corey Huinker |
---|---|
Тема | Re: Statistics Import and Export |
Дата | |
Msg-id | CADkLM=d4U6hjoLGx2tRxLzSsEDYz7oj8PmmTYPKmnfPk5RLzKQ@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Statistics Import and Export (Nathan Bossart <nathandbossart@gmail.com>) |
Ответы |
Re: Statistics Import and Export
|
Список | pgsql-hackers |
> Also, why do we need the clause "WHERE s.tablename = ANY($2)"? Isn't
> that already implied by "JOIN unnest($1, $2) ... s.tablename =
> u.tablename"?
Good question. Corey, do you recall why this was needed?
In my patch, that SQL statement came with the comment:
+ /*
+ * The results must be in the order of relations supplied in the
+ * parameters to ensure that they are in sync with a walk of the TOC.
+ *
+ * The redundant (and incomplete) filter clause on s.tablename = ANY(...)
+ * is a way to lead the query into using the index
+ * pg_class_relname_nsp_index which in turn allows the planner to avoid an
+ * expensive full scan of pg_stats.
+ *
+ * We may need to adjust this query for versions that are not so easily
+ * led.
+ */
+ * The results must be in the order of relations supplied in the
+ * parameters to ensure that they are in sync with a walk of the TOC.
+ *
+ * The redundant (and incomplete) filter clause on s.tablename = ANY(...)
+ * is a way to lead the query into using the index
+ * pg_class_relname_nsp_index which in turn allows the planner to avoid an
+ * expensive full scan of pg_stats.
+ *
+ * We may need to adjust this query for versions that are not so easily
+ * led.
+ */
В списке pgsql-hackers по дате отправления: