Update code and data

This commit is contained in:
Regina Obe
2026-01-17 18:57:46 -05:00
parent 5ba13f6470
commit 85c6b50be2
16 changed files with 245624 additions and 239 deletions

19
ch04/build_stats.psql Normal file
View File

@@ -0,0 +1,19 @@
\a
\t
\cd /tmp
\g create_script.sql
DROP TABLE IF EXISTS table_stats;
SELECT
'CREATE TABLE table_stats (
table_name varchar(255), count bigint);';
SELECT format(''INSERT INTO TABLE staging.table_stats(
table_name, count
)
VALUES (%1$I.%2$I,
(SELECT COUNT(1)
FROM %1$I.%2$I
) )', table_schema, table_name)
FROM information_schema.tables
WHERE table_schema = 'pg_catalog';
\o
\i create_script.sql