What Indexes Are and Why They Exist
An index is a sorted lookup structure the database maintains for you. Learn how a B-tree finds a row, what an index costs, and the clustered index in...
963 published notes across every category.
An index is a sorted lookup structure the database maintains for you. Learn how a B-tree finds a row, what an index costs, and the clustered index in...
Multi column indexes and why their order decides everything: the leftmost prefix rule, selectivity, covering indexes and index only scans.
Indexes are not free. Learn the cases where the optimiser correctly ignores them, how to find unused and duplicate indexes, and how to maintain them.
What happens between typing a query and getting rows, and how to read an execution plan - the single most useful performance skill in SQL.
What the engine actually does: full scans versus index seeks, nested loop and hash joins, and why a sort or a temporary table appears in your plan.
A practical checklist for making a slow query fast, and the specific fix for deep pagination that no amount of indexing solves.
Why string concatenation lets user input rewrite your query, and why prepared statements make it structurally impossible - with the cases parameters c...
Controlling who can do what: creating users, granting the minimum needed, grouping privileges into roles, and the accounts a typical application actua...
One reference table for the differences that actually break code: paging, auto increment, strings, dates, upserts and the features each product lacks.
How much portability is worth paying for, which constructs are safe everywhere, and how to isolate the parts that can never be portable.
Twenty graded exercises on SELECT, filtering, sorting and simple functions, each with a worked solution and the reason it is written that way.
Fifteen exercises combining joins, grouping and having, each with the solution and a note on the trap it was designed to expose.