mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-03-11 01:35:22 +01:00
9 lines
367 B
PL/PgSQL
9 lines
367 B
PL/PgSQL
CREATE OR REPLACE FUNCTION is_pending(status TEXT)
|
|
RETURNS BOOLEAN AS $$
|
|
SELECT status = 'Processing' OR status = 'New';
|
|
$$ LANGUAGE sql IMMUTABLE;
|
|
|
|
CREATE INDEX "IX_Invoices_Pending" ON "Invoices"((1)) WHERE is_pending("Status");
|
|
CREATE INDEX "IX_Payments_Pending" ON "Payments"((1)) WHERE is_pending("Status");
|
|
DROP TABLE "PendingInvoices";
|
|
ANALYZE "Invoices";
|