我正在寻找如何加速仅基于两个表的查询的想法。我添加了索引,运行真空。
表格:
CREATE TABLE vintage_unit
(
id integer NOT NULL,
vintage_unit_date date,
origination_month timestamp with time zone,
product character varying,
customer_type character varying,
balance numeric,
CONSTRAINT pk_id_loan PRIMARY KEY (id)
);
CREATE INDEX id_vintage_unit_date ON vintage_unit USING btree (vintage_unit_date);
CREATE INDEX ind_customer_type ON vintage_unit USING btree (customer_type COLLATE pg_catalog."default");
CREATE INDEX ind_origination_month ON vintage_unit USING btree (origination_month);
CREATE INDEX ind_product ON vintage_unit USING btree (product COLLATE pg_catalog."default");
CREATE TABLE performance_event
(
id integer,
event_date date
);
CREATE INDEX ind_event_date ON …
Run Code Online (Sandbox Code Playgroud) postgresql ×1