Skip to content

Commit f159ada

Browse files
committed
chore: Added indexing in the database
1 parent 9ba9ec1 commit f159ada

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

chart/database/schemas/data.sql

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,16 @@ CREATE TABLE if not exists currency(
33
conv_currency TEXT NOT NULL,
44
rate FLOAT NOT NULL,
55
date DATE NOT NULL
6-
);
6+
);
7+
8+
CREATE INDEX IF NOT EXISTS currency_from_currency_conv_currency_idx
9+
ON public.currency USING btree
10+
(from_currency COLLATE pg_catalog."default" ASC NULLS LAST, conv_currency COLLATE pg_catalog."default" ASC NULLS LAST)
11+
WITH (deduplicate_items=True)
12+
TABLESPACE pg_default;
13+
14+
CREATE INDEX IF NOT EXISTS currency_date_idx
15+
ON public.currency USING btree
16+
(date ASC NULLS LAST)
17+
WITH (deduplicate_items=True)
18+
TABLESPACE pg_default;

shared/database/data/schema.sql

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,16 @@ CREATE TABLE IF NOT EXISTS currency(
33
conv_currency TEXT NOT NULL,
44
rate FLOAT NOT NULL,
55
date DATE NOT NULL
6-
);
6+
);
7+
8+
CREATE INDEX IF NOT EXISTS currency_from_currency_conv_currency_idx
9+
ON public.currency USING btree
10+
(from_currency COLLATE pg_catalog."default" ASC NULLS LAST, conv_currency COLLATE pg_catalog."default" ASC NULLS LAST)
11+
WITH (deduplicate_items=True)
12+
TABLESPACE pg_default;
13+
14+
CREATE INDEX IF NOT EXISTS currency_date_idx
15+
ON public.currency USING btree
16+
(date ASC NULLS LAST)
17+
WITH (deduplicate_items=True)
18+
TABLESPACE pg_default;

0 commit comments

Comments
 (0)