mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-01-18 13:26:47 +01:00
10 lines
367 B
PL/PgSQL
10 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";
|