SQL-scripts
SQL-scripts copied to clipboard
100+ SQL Scripts - PostgreSQL, MySQL, Google BigQuery, MariaDB, AWS Athena. DevOps / DBA / Analytics / performance engineering. Google BigQuery ML machine learning classification.
https://github.com/HariSekhon/SQL-scripts/blob/54cc9cef687ba3a242688866b6af76956f23865c/postgres_queries_slow.sql#L16C5-L16C71 eg ``` SELECT interval '1 millisecond' * total_exec_time AS total_exec_time, to_char((total_exec_time/sum(total_exec_time) OVER()) * 100, 'FM90D0') || '%' AS prop_exec_time, to_char(calls, 'FM999G999G999G990') AS ncalls, interval '1 millisecond' * (blk_read_time +...
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))