Skip to content

Commit ab1aeca

Browse files
oliricedarora
authored andcommitted
add index_advisor tests
1 parent 2619b79 commit ab1aeca

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

nix/tests/expected/index_advisor.out

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
create schema v;
2+
create table v.book(
3+
id int primary key,
4+
title text not null
5+
);
6+
select
7+
index_statements, errors
8+
from
9+
index_advisor('select id from v.book where title = $1');
10+
index_statements | errors
11+
------------------------------------------------+--------
12+
{"CREATE INDEX ON v.book USING btree (title)"} | {}
13+
(1 row)
14+
15+
drop schema v cascade;
16+
NOTICE: drop cascades to table v.book

nix/tests/sql/index_advisor.sql

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
create schema v;
2+
3+
create table v.book(
4+
id int primary key,
5+
title text not null
6+
);
7+
8+
select
9+
index_statements, errors
10+
from
11+
index_advisor('select id from v.book where title = $1');
12+
13+
drop schema v cascade;

0 commit comments

Comments
 (0)