HariSekhon / SQL-scripts

100+ SQL Scripts - PostgreSQL, MySQL, Oracle, Google BigQuery, MariaDB, AWS Athena. DBA, Analytics, DevOps, performance engineering. Google BigQuery ML machine learning classification.
MIT License
392 stars 111 forks source link

broken query when using mixedCaseNames #2

Open mariusa opened 1 year ago

mariusa commented 1 year ago

Hi,

pg_size_pretty(pg_relation_size(indexrelname::regclass)) https://github.com/HariSekhon/SQL-scripts/blob/54cc9cef687ba3a242688866b6af76956f23865c/postgres_indexes_unused.sql#L19C1-L38C49

says index "mixedcasename" doesn't exist, but it's actual name is "mixedCaseName"

I've changed to this to fix: pg_size_pretty(pg_relation_size(indexrelid))

mariusa commented 1 year ago

Also, please exclude indexes named "pg_%"

Thanks

PS: your name is close to https://en.wikipedia.org/wiki/Hari_Seldon :)