Database Lab

Database Lab

Pick a query, add an index, and watch the plan change.

Schema

orders~4.8M rows
idbigint
user_idbigint
statustext
created_attimestamptz
totalnumeric
users~310K rows
idbigintindexed
emailtext
countrytext

Index Builder

idx_orders_user_id

orders.user_id

idx_orders_status

orders.status

idx_orders_created_at

orders.created_at

idx_users_id

users.id

primary key
SELECT *
FROM orders
WHERE status = 'pending'
  AND created_at > now() - interval '7 days';
idx_orders_statusidx_orders_created_at