PostGIS Related Database parameters

Source: Internet
Author: User
Tags create index postgis

First, the table structure definition

--Table:public.tbl_buildings


--DROP TABLE public.tbl_buildings;


CREATE TABLE public.tbl_buildings

(

ID character (7) not NULL,

Name character (20),

Type character (10),

Address character (30),

The_geom geometry,

CONSTRAINT Tbl_buildings_pkey PRIMARY KEY (ID)

)


Column Changes

SELECT dropgeometrycolumn (' tbl_properties ', ' The_geom ')

SELECT addgeometrycolumn (' tbl_properties ', ' The_geom ', 4326,

' Point ', 2);

Add data

INSERT into Tbl_properties (ID, town, Postal_Code, Street,

"Number", The_geom) VALUES (1, ' London ', ' N7 6PA ', ' Holloway Road ',

St_geomfromewkt (' srid=4326; Point (51.556173-0.116190));


Second, Geometry column establish GIST index


CREATE INDEX idx_geo_buildings on tbl_buildings USING GIST (THE_GEOM);


Third, database parameters

1.checkpoint_segments (9.5 ago)

Default Value:3

Suggested Value:6

-----------------------------------

Max_wal_size (after 9.5)

Default value:1 GB


2.constraint_exclusion

Default value:deactivated

Suggested value:activated, partition


3.maintenance_work_mem

Default value:16

Suggested value:128


4.random_page_cost

Default Value 4.0

Suggested Value 2.0



5.shared_buffers

Default value:32 MB

Suggested value:64 MB to MB unlikely for a allocation of more than-percent

of RAM (Windows), 25% physical Memory (Linux)


6.wal_buffers

Default VALUE:64KB

Suggested VALUE:1MB


7.work_mem

Default VALUE:1MB

Suggested VALUE:16MB


The above are recommended values, the specific needs of the system according to the operation of the changes.

This article is from the "Yiyi" blog, make sure to keep this source http://heyiyi.blog.51cto.com/205455/1870227

PostGIS Related Database parameters

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.