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! |