Skip to content

Commit 09fb77c

Browse files
committed
remove estimates
1 parent b1bec5d commit 09fb77c

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

coderd/database/migrations/000009_audit_logs.up.sql

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -35,22 +35,3 @@ CREATE INDEX idx_audit_logs_time_desc ON audit_logs USING btree ("time" DESC);
3535
CREATE INDEX idx_audit_log_user_id ON audit_logs USING btree (user_id);
3636
CREATE INDEX idx_audit_log_organization_id ON audit_logs USING btree (organization_id);
3737
CREATE INDEX idx_audit_log_resource_id ON audit_logs USING btree (resource_id);
38-
39-
-- count_estimate returns the number of rows the query planner estimates the
40-
-- provided query will return.
41-
CREATE FUNCTION count_estimate(query text)
42-
RETURNS integer
43-
LANGUAGE plpgsql AS
44-
$func$
45-
DECLARE
46-
rec record;
47-
rows integer;
48-
BEGIN
49-
FOR rec IN EXECUTE 'EXPLAIN ' || query LOOP
50-
rows := substring(rec."QUERY PLAN" FROM ' rows=([[:digit:]]+)');
51-
EXIT WHEN rows IS NOT NULL;
52-
END LOOP;
53-
54-
RETURN rows;
55-
END
56-
$func$;

0 commit comments

Comments
 (0)