From f0db18d7314a63b3f4a00e6294a5ae3f124cf273 Mon Sep 17 00:00:00 2001 From: Mariusz Sielski Date: Sun, 2 Dec 2018 10:17:37 +0100 Subject: [PATCH] add indexes on ft1 --- sql/create.sql | 2 +- sql/indexes.sql | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 sql/indexes.sql diff --git a/sql/create.sql b/sql/create.sql index 21c2e2d..7ef8f82 100644 --- a/sql/create.sql +++ b/sql/create.sql @@ -82,7 +82,7 @@ CREATE TABLE FT1_Registration ( --claim status do uspójnienia z tabelą dim_status, wydaje mi się, że można by dodać przedrostek claim do kolumn, będzie czytelniej :) claim_status_fk integer FOREIGN KEY REFERENCES dim_claim_statuses(claim_status_sk), indication_fk integer FOREIGN KEY REFERENCES dim_indications(indication_sk), - claim_number integer, + claim_number NVARCHAR(50), -- cnt jest tylko zliczeniowy, będzie miał 1, więc dałbym tinyint cnt tinyint, ); diff --git a/sql/indexes.sql b/sql/indexes.sql new file mode 100644 index 0000000..0fc29b2 --- /dev/null +++ b/sql/indexes.sql @@ -0,0 +1,32 @@ +DROP INDEX IF EXISTS expected_response_time_fk_ft1_index ON FT1_Registration; +CREATE INDEX expected_response_time_fk_ft1_index ON FT1_Registration(expected_response_time_fk); + +DROP INDEX IF EXISTS submission_date_fk_ft1_index ON FT1_Registration; +CREATE INDEX submission_date_fk_ft1_index ON FT1_Registration(submission_date_fk); + +DROP INDEX IF EXISTS submission_date_fk_ft1_index ON FT1_Registration; +CREATE INDEX submission_date_fk_ft1_index ON FT1_Registration(submission_date_fk); + +DROP INDEX IF EXISTS response_time_fk_ft1_index ON FT1_Registration; +CREATE INDEX response_time_fk_ft1_index ON FT1_Registration(response_time_fk); + +DROP INDEX IF EXISTS drug_fk_ft1_index ON FT1_Registration; +CREATE INDEX drug_fk_ft1_index ON FT1_Registration(drug_fk); + +DROP INDEX IF EXISTS factory_API_fk_ft1_index ON FT1_Registration; +CREATE INDEX factory_API_fk_ft1_index ON FT1_Registration(factory_API_fk); + +DROP INDEX IF EXISTS factory_bulk_fk_ft1_index ON FT1_Registration; +CREATE INDEX factory_bulk_fk_ft1_index ON FT1_Registration(factory_bulk_fk); + +DROP INDEX IF EXISTS factory_package_fk_ft1_index ON FT1_Registration; +CREATE INDEX factory_package_fk_ft1_index ON FT1_Registration(factory_package_fk); + +DROP INDEX IF EXISTS country_fk_ft1_index ON FT1_Registration; +CREATE INDEX country_fk_ft1_index ON FT1_Registration(country_fk); + +DROP INDEX IF EXISTS claim_status_fk_ft1_index ON FT1_Registration; +CREATE INDEX claim_status_fk_ft1_index ON FT1_Registration(claim_status_fk); + +DROP INDEX IF EXISTS indication_fk_ft1_index ON FT1_Registration; +CREATE INDEX indication_fk_ft1_index ON FT1_Registration(indication_fk); \ No newline at end of file