For some research purposes, I am trying to modify the existing statistics
of some tables in the catalogs in order to change the execution plan,
experiment with the EXPLAIN call etc.

Concretely, what I'd like to do is to create a "fake" table with a schema
of my choice (that's the easy part) and then modify the
statistics(particularly, the number of tuples and the number of pages).

Firstly, I create an empty table (CREATE TABLE newTable(....)) and then I
update the pg_class table as well (UPDATE pg_class SET relpages = #pages
WHERE relname='newTable').

The problem is that, even if I set the reltuples and relpages of my choice,
when I run the EXPLAIN clause for a query in which the 'newTable'  is
involved in (e.g. EXPLAIN SELECT * FROM newTable), I get the same cost and
row estimation.

Could anyone help me with that?

Thank you in advance,

Victor Giannakouris

Reply via email to