pg_scripts icon indicating copy to clipboard operation
pg_scripts copied to clipboard

Indexing JSON data

Open andyatkinson opened this issue 1 year ago • 0 comments

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'));

andyatkinson avatar Oct 16 '24 22:10 andyatkinson