This simple extension helps you to determine possible problems with amount of pages/ tuples during query run.

Here is one small query which shows basic statistics for table:

with obj as ( select '...schame.tablename....'::text as _name),
srcdata as ( select * from obj o join lateral
(select *, (select pg_relpages from pg_relpages(o._name) ) as pg_relpages from pgstattuple( o._name)) a on true)
select tuple_len/tuple_count as _row_len, tuple_count/pg_relpages as tuples_per_page, * from srcdata