pg_scripts
pg_scripts copied to clipboard
Indexing JSON data
Indexing JSON data
tl;dr: Create a B-tree index that matches the JSON expression being used, to lift that field data into the index definition, which makes it fast to access/filter on
CREATE INDEX idx_customer_id ON stripe_events ((data ->> 'customer_id'));