Paid Orders by Date
Finance analytics looks only at rows in orders with status = 'paid', starting from a given created_at. Create a compact partial index on created_at only for paid orders.
Speed this query up with an index
CREATE INDEX ix_orders_paid_created ON orders (created_at) WHERE status = 'paid'
Doar CREATE/ALTER/DROP — nu este nevoie de un SELECT la final.
Conectează-te pentru a vedea istoricul soluțiilor trimise
Conectează-teConectează-te pentru a folosi Mentorul AI
Conectează-te