Skip to content

Instantly share code, notes, and snippets.

@kamidev
kamidev / zig_install_m3_max_macos.md
Last active May 2, 2024 08:35
zig_macos_m3_max_install

Personal notes building zig 0.13.0-dev.xxxx on Macbook M3 Max

This probably works on all current Apple Silicon Macs, but you must check other models yourself. Newer Intel Macs are also likely to work, with one significant difference: Homebrew has a different default path.

20230926: Updated for macOS Sonoma, Homebrew-installed LLVM 17.01 and latest XCode Commandline Tools

20231001: Build zig binaries for both release and debug mode (with release mode as default)

20231212: Updated for Sonoma 14.2, Homebrew-installed LLVM 17.0.6 and latest XCode Commandline Tools

@dmitry-naumenko
dmitry-naumenko / get_unused_indexes_en.sql
Created January 10, 2020 10:01
Identify unused indexes.
SELECT
idstat.relname AS TABLE_NAME,
indexrelname AS index_name,
idstat.idx_scan AS index_scans_count,
pg_size_pretty(pg_relation_size(indexrelid)) AS index_size,
tabstat.idx_scan AS table_reads_index_count,
tabstat.seq_scan AS table_reads_seq_count,
tabstat.seq_scan + tabstat.idx_scan AS table_reads_count,
n_tup_upd + n_tup_ins + n_tup_del AS table_writes_count,
pg_size_pretty(pg_relation_size(idstat.relid)) AS table_size