Indexes & Performance. Index Types. B-tree — default, great for =, <, >, BETWEEN, LIKE prefix. Hash — only equality (=), faster than B-tree for exact lookups. GIN — arrays, JSONB, full-text search, @> operator. GiST — ge…
ReadAdvanced Features. Window Functions. -- ROW_NUMBER, RANK, DENSE_RANK SELECT name, department, salary, ROW_NUMBER() OVER (PARTITION BY department ORDER BY salary DESC) AS row_num, RANK() OVER (PARTITION BY department ORDE…
ReadPostgreSQL Interview Questions. Q: What is the difference between CHAR, VARCHAR, and TEXT?. CHAR(n) is fixed-length, padded with spaces. VARCHAR(n) is variable-length with a max. TEXT is unlimited variable-length. In Pos…
ReadQueries & Joins. Basic SELECT. -- Basic query SELECT id, name, email FROM users WHERE active = true ORDER BY name LIMIT 10 OFFSET 20; -- Aliases and expressions SELECT first_name || ' ' || last_name AS full_name, EXTRACT…
ReadSave this stack to your personal DevRecall — add your own notes, track what you're learning, and share what you know with the community.
Get started — free forever