Indexing and Querying JSONB Efficiently in PostgreSQL

A JSONB column with no index is a slow column. Every containment query scans the whole table, parsing JSON on each row. That's fine for a lookup table and a disaster for a million-row events table.