diff --git a/crates/sui-indexer/migrations/pg/2023-10-24-160139_query_cost_function/down.sql b/crates/sui-indexer/migrations/pg/2023-10-24-160139_query_cost_function/down.sql deleted file mode 100644 index 742f7001fc58fe..00000000000000 --- a/crates/sui-indexer/migrations/pg/2023-10-24-160139_query_cost_function/down.sql +++ /dev/null @@ -1,2 +0,0 @@ --- This file should undo anything in `up.sql` -DROP FUNCTION IF EXISTS query_cost(TEXT); diff --git a/crates/sui-indexer/migrations/pg/2023-10-24-160139_query_cost_function/up.sql b/crates/sui-indexer/migrations/pg/2023-10-24-160139_query_cost_function/up.sql deleted file mode 100644 index 7296c688baa7f6..00000000000000 --- a/crates/sui-indexer/migrations/pg/2023-10-24-160139_query_cost_function/up.sql +++ /dev/null @@ -1,15 +0,0 @@ --- Your SQL goes here -CREATE OR REPLACE FUNCTION query_cost( - query_in text, - cost OUT float8 - ) RETURNS float8 AS -$$DECLARE - p json; -BEGIN - /* get execution plan in JSON */ - EXECUTE 'EXPLAIN (FORMAT JSON) ' || query_in INTO p; - /* extract total cost */ - SELECT p->0->'Plan'->>'Total Cost' - INTO cost; - RETURN; -END;$$ LANGUAGE plpgsql STRICT;