# Output of requested queries Note, I cannot intentionally make Django 4.2 with postgres 13 operate fast without the custom autovac settings. I am providing 3 cases, as described below. It's notable that the custom autovac settings run a smidge slower than they do on postgres 10. ## Code with connection.cursor() as cursor: qry = ( "SELECT relname, reltuples,relpages,pg_relation_size(oid) from pg_class " "where oid = '\"DataRepo_peakdata\"'::regclass;" ) print(f"RUNNING QUERY: {qry}") cursor.execute(qry) for l in cursor.fetchall(): print(l) qry = ( "select c.relname, c.reltuples, c.relpages, pg_relation_size(c.oid) " "from pg_class c inner join pg_index i on c.oid=i.indexrelid where " "i.indrelid = '\"DataRepo_peakdata\"'::regclass;" ) print(f"RUNNING QUERY: {qry}") cursor.execute(qry) for l in cursor.fetchall(): print(l) ## Output ### With custom autovac settings, pg13, Dj4.2.4 (fast): RUNNING QUERY: SELECT relname, reltuples,relpages,pg_relation_size(oid) from pg_class where oid = '"DataRepo_peakdata"'::regclass; ('DataRepo_peakdata', 0.0, 0, 458752) RUNNING QUERY: select c.relname, c.reltuples, c.relpages, pg_relation_size(c.oid) from pg_class c inner join pg_index i on c.oid=i.indexrelid where i.indrelid = '"DataRepo_peakdata"'::regclass; ('DataRepo_peakdata_pkey', 0.0, 1, 212992) ('DataRepo_peakdata_peak_group_id_4dd87f4a', 0.0, 1, 106496) carbon count time: 0.234 nitrogen count time: 0.218 ### No custom autovac settings, pg13, Dj4.2.4 (slow): RUNNING QUERY: SELECT relname, reltuples,relpages,pg_relation_size(oid) from pg_class where oid = '"DataRepo_peakdata"'::regclass; ('DataRepo_peakdata', 0.0, 20, 417792) RUNNING QUERY: select c.relname, c.reltuples, c.relpages, pg_relation_size(c.oid) from pg_class c inner join pg_index i on c.oid=i.indexrelid where i.indrelid = '"DataRepo_peakdata"'::regclass; ('DataRepo_peakdata_pkey', 0.0, 10, 212992) ('DataRepo_peakdata_peak_group_id_4dd87f4a', 0.0, 6, 106496) ^C (BTW, ^C does nothing here. I have to ^Z and kill.) ### No custom autovac settings, pg10, Dj3.2.20 (fast): RUNNING QUERY: SELECT relname, reltuples,relpages,pg_relation_size(oid) from pg_class where oid = '"DataRepo_peakdata"'::regclass; ('DataRepo_peakdata', 1128.0, 13, 417792) RUNNING QUERY: select c.relname, c.reltuples, c.relpages, pg_relation_size(c.oid) from pg_class c inner join pg_index i on c.oid=i.indexrelid where i.indrelid = '"DataRepo_peakdata"'::regclass; ('DataRepo_peakdata_peak_group_id_4dd87f4a', 1128.0, 7, 212992) ('DataRepo_peakdata_pkey', 1128.0, 7, 212992) carbon count time: 0.008 nitrogen count time: 0.003