How to specify/mock the statistic data of tables in PostgreSQL

Поиск
Список
Период
Сортировка
От ygnhzeus
Тема How to specify/mock the statistic data of tables in PostgreSQL
Дата
Msg-id 52CFB699.2030609@gmail.com
обсуждение исходный текст
Ответы Re: How to specify/mock the statistic data of tables in PostgreSQL
Список pgsql-general

Hi all,

I want to use PostgreSQL to help me calculate the cardinality/selectivity of some queries, but I do not want to insert any data into these tables(since the data size is huge) to PostgreSQL. So I plan to calculate the statistic data by myself (not in PostgreSQL) and manually specify the metrics (maybe by modifying pg_statistic table) in PostgreSQL, thus PG's optimizer may use these statistic to evaluate the query (Explain...). Here comes the problem:

 

1. Is it possible to do what I've described above?

2. I've took a look at the pg_statistic table and pg_stats view, in the view I saw that most_common_elems/most_common_elem_freqs/elem_count_histogram were empty, and I'm also a little confused about the column called correlation. Is there any detailed document about how these metrics are calculated in PostgreSQL?

 

Thanks!

 

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

Предыдущее
От: Sameer Kumar
Дата:
Сообщение: Re: argument of CASE/WHEN must not return a set
Следующее
От: Luca Ferrari
Дата:
Сообщение: Re: wal archive peak during pg_dump