简体   繁体   中英

How to create a Gin index on a geometry column in Postgresql?

According to pgAdmin 4 4.21 documentation » Creating or Modifying a Table »

Select gin to create a GIN index. A GIN index may improve performance when managing two-dimensional geometric data types and nearest-neighbor searches

We should create a Gin index for geometric column if we intend to use Nearest-neighbor searches, Which I do!

However, when defining Gin index it asks for Operator Class and there are two options there ( jsonb_path_obs and gin_int_ops ) but none of them works with Geometry type.

Could someone please tell me how to create a Gin index on a Geometry type column?

PS by geometry I mean PostGIS's geometry column type

Please link to the thing you are quoting so we don't have to go searching for it.

That looks like a bug in the pgadmin4 docs. They seem to have the GIN and GiST labels reversed in those descriptions. GIN supports multiple keys better than GiST does, but doesn't support nearest-neighbor or spatial. You want a GiST index.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM