PostgreSQL创建索引例子

来源:互联网 发布:传奇h5修改数据库教程 编辑:程序博客网 时间:2024/06/05 10:13


--10索引
CREATE INDEX ds_product_imagery_gf2_10_centertime_idx
    ON public.ds_product_imagery_gf2_10 USING btree
    (centertime DESC)
    TABLESPACE pg_default;




CREATE INDEX ds_product_imagery_gf2_10_fbounds_idx
    ON public.ds_product_imagery_gf2_10 USING gist
    (fbounds)
    TABLESPACE pg_default;




CREATE INDEX ds_product_imagery_gf2_10_fgeometry_idx
    ON public.ds_product_imagery_gf2_10 USING btree
    (fgeometry)
    TABLESPACE pg_default;




CREATE INDEX ds_product_imagery_gf2_10_satellite_sensor_idx
    ON public.ds_product_imagery_gf2_10 USING btree
    (satellite COLLATE pg_catalog."default" DESC, sensor COLLATE pg_catalog."default" DESC)
    TABLESPACE pg_default;


ALTER TABLE public.ds_product_imagery_gf2_10
    ADD CONSTRAINT ds_product_imagery_gf2_10_pkey PRIMARY KEY (id);


--11索引
CREATE INDEX ds_product_imagery_gf2_11_centertime_idx
    ON public.ds_product_imagery_gf2_11 USING btree
    (centertime DESC)
    TABLESPACE pg_default;




CREATE INDEX ds_product_imagery_gf2_11_fbounds_idx
    ON public.ds_product_imagery_gf2_11 USING gist
    (fbounds)
    TABLESPACE pg_default;




CREATE INDEX ds_product_imagery_gf2_11_fgeometry_idx
    ON public.ds_product_imagery_gf2_11 USING btree
    (fgeometry)
    TABLESPACE pg_default;




CREATE INDEX ds_product_imagery_gf2_11_satellite_sensor_idx
    ON public.ds_product_imagery_gf2_11 USING btree
    (satellite COLLATE pg_catalog."default" DESC, sensor COLLATE pg_catalog."default" DESC)
    TABLESPACE pg_default;


ALTER TABLE public.ds_product_imagery_gf2_11
    ADD CONSTRAINT ds_product_imagery_gf2_11_pkey PRIMARY KEY (id);


--12索引
CREATE INDEX ds_product_imagery_gf2_12_centertime_idx
    ON public.ds_product_imagery_gf2_12 USING btree
    (centertime DESC)
    TABLESPACE pg_default;




CREATE INDEX ds_product_imagery_gf2_12_fbounds_idx
    ON public.ds_product_imagery_gf2_12 USING gist
    (fbounds)
    TABLESPACE pg_default;




CREATE INDEX ds_product_imagery_gf2_12_fgeometry_idx
    ON public.ds_product_imagery_gf2_12 USING btree
    (fgeometry)
    TABLESPACE pg_default;




CREATE INDEX ds_product_imagery_gf2_12_satellite_sensor_idx
    ON public.ds_product_imagery_gf2_12 USING btree
    (satellite COLLATE pg_catalog."default" DESC, sensor COLLATE pg_catalog."default" DESC)
    TABLESPACE pg_default;


ALTER TABLE public.ds_product_imagery_gf2_12
    ADD CONSTRAINT ds_product_imagery_gf2_12_pkey PRIMARY KEY (id);




--13索引
CREATE INDEX ds_product_imagery_gf2_13_centertime_idx
    ON public.ds_product_imagery_gf2_13 USING btree
    (centertime DESC)
    TABLESPACE pg_default;




CREATE INDEX ds_product_imagery_gf2_13_fbounds_idx
    ON public.ds_product_imagery_gf2_13 USING gist
    (fbounds)
    TABLESPACE pg_default;




CREATE INDEX ds_product_imagery_gf2_13_fgeometry_idx
    ON public.ds_product_imagery_gf2_13 USING btree
    (fgeometry)
    TABLESPACE pg_default;




CREATE INDEX ds_product_imagery_gf2_13_satellite_sensor_idx
    ON public.ds_product_imagery_gf2_13 USING btree
    (satellite COLLATE pg_catalog."default" DESC, sensor COLLATE pg_catalog."default" DESC)
    TABLESPACE pg_default;


ALTER TABLE public.ds_product_imagery_gf2_13
    ADD CONSTRAINT ds_product_imagery_gf2_13_pkey PRIMARY KEY (id);


--14索引
CREATE INDEX ds_product_imagery_gf2_14_centertime_idx
    ON public.ds_product_imagery_gf2_14 USING btree
    (centertime DESC)
    TABLESPACE pg_default;




CREATE INDEX ds_product_imagery_gf2_14_fbounds_idx
    ON public.ds_product_imagery_gf2_14 USING gist
    (fbounds)
    TABLESPACE pg_default;




CREATE INDEX ds_product_imagery_gf2_14_fgeometry_idx
    ON public.ds_product_imagery_gf2_14 USING btree
    (fgeometry)
    TABLESPACE pg_default;




CREATE INDEX ds_product_imagery_gf2_14_satellite_sensor_idx
    ON public.ds_product_imagery_gf2_14 USING btree
    (satellite COLLATE pg_catalog."default" DESC, sensor COLLATE pg_catalog."default" DESC)
    TABLESPACE pg_default;


ALTER TABLE public.ds_product_imagery_gf2_14
    ADD CONSTRAINT ds_product_imagery_gf2_14_pkey PRIMARY KEY (id);


--15索引
CREATE INDEX ds_product_imagery_gf2_15_centertime_idx
    ON public.ds_product_imagery_gf2_15 USING btree
    (centertime DESC)
    TABLESPACE pg_default;




CREATE INDEX ds_product_imagery_gf2_15_fbounds_idx
    ON public.ds_product_imagery_gf2_15 USING gist
    (fbounds)
    TABLESPACE pg_default;




CREATE INDEX ds_product_imagery_gf2_15_fgeometry_idx
    ON public.ds_product_imagery_gf2_15 USING btree
    (fgeometry)
    TABLESPACE pg_default;




CREATE INDEX ds_product_imagery_gf2_15_satellite_sensor_idx
    ON public.ds_product_imagery_gf2_15 USING btree
    (satellite COLLATE pg_catalog."default" DESC, sensor COLLATE pg_catalog."default" DESC)
    TABLESPACE pg_default;


ALTER TABLE public.ds_product_imagery_gf2_15
    ADD CONSTRAINT ds_product_imagery_gf2_15_pkey PRIMARY KEY (id);


--16索引


CREATE INDEX ds_product_imagery_gf2_16_centertime_idx
    ON public.ds_product_imagery_gf2_16 USING btree
    (centertime DESC)
    TABLESPACE pg_default;




CREATE INDEX ds_product_imagery_gf2_16_fbounds_idx
    ON public.ds_product_imagery_gf2_16 USING gist
    (fbounds)
    TABLESPACE pg_default;




CREATE INDEX ds_product_imagery_gf2_16_fgeometry_idx
    ON public.ds_product_imagery_gf2_16 USING btree
    (fgeometry)
    TABLESPACE pg_default;




CREATE INDEX ds_product_imagery_gf2_16_satellite_sensor_idx
    ON public.ds_product_imagery_gf2_16 USING btree
    (satellite COLLATE pg_catalog."default" DESC, sensor COLLATE pg_catalog."default" DESC)
    TABLESPACE pg_default;


ALTER TABLE public.ds_product_imagery_gf2_16
    ADD CONSTRAINT ds_product_imagery_gf2_16_pkey PRIMARY KEY (id);


--17索引
CREATE INDEX ds_product_imagery_gf2_17_centertime_idx
    ON public.ds_product_imagery_gf2_17 USING btree
    (centertime DESC)
    TABLESPACE pg_default;




CREATE INDEX ds_product_imagery_gf2_17_fbounds_idx
    ON public.ds_product_imagery_gf2_17 USING gist
    (fbounds)
    TABLESPACE pg_default;




CREATE INDEX ds_product_imagery_gf2_17_fgeometry_idx
    ON public.ds_product_imagery_gf2_17 USING btree
    (fgeometry)
    TABLESPACE pg_default;




CREATE INDEX ds_product_imagery_gf2_17_satellite_sensor_idx
    ON public.ds_product_imagery_gf2_17 USING btree
    (satellite COLLATE pg_catalog."default" DESC, sensor COLLATE pg_catalog."default" DESC)
    TABLESPACE pg_default;


ALTER TABLE public.ds_product_imagery_gf2_17
    ADD CONSTRAINT ds_product_imagery_gf2_17_pkey PRIMARY KEY (id);








CREATE INDEX ds_product_imagery_gf2_10_id_idx
    ON public.ds_product_imagery_gf2_10 USING btree
    (id)
    TABLESPACE pg_default;
CREATE INDEX ds_product_imagery_gf2_11_id_idx
    ON public.ds_product_imagery_gf2_11 USING btree
    (id)
    TABLESPACE pg_default;
CREATE INDEX ds_product_imagery_gf2_12_id_idx
    ON public.ds_product_imagery_gf2_12 USING btree
    (id)
    TABLESPACE pg_default;
CREATE INDEX ds_product_imagery_gf2_13_id_idx
    ON public.ds_product_imagery_gf2_13 USING btree
    (id)
    TABLESPACE pg_default;
CREATE INDEX ds_product_imagery_gf2_14_id_idx
    ON public.ds_product_imagery_gf2_14 USING btree
    (id)
    TABLESPACE pg_default;
CREATE INDEX ds_product_imagery_gf2_15_id_idx
    ON public.ds_product_imagery_gf2_15 USING btree
    (id)
    TABLESPACE pg_default;
CREATE INDEX ds_product_imagery_gf2_16_id_idx
    ON public.ds_product_imagery_gf2_16 USING btree
    (id)
    TABLESPACE pg_default;
CREATE INDEX ds_product_imagery_gf2_17_id_idx
    ON public.ds_product_imagery_gf2_17 USING btree
    (id)
    TABLESPACE pg_default;