return`select ((c.reltuples/case when c.relpages=0 then 1 else c.relpages end) * (pg_relation_size(c.oid) / (current_setting('block_size')::integer)))::integer as estimated_rows
from pg_class c JOIN pg_namespace n on c.relnamespace = n.oid
where n.nspname='${ts.namespace}' and c.relname='${ts.tablename}'