Support GiST Index type with Postgres
See original GitHub issueProblem
I’m trying to use Prisma with geographic data in PostGIS. There’s an issue to track actual PostGIS support (#1798) but this is a narrower concern - the support of GiST indexes. These were mentioned when index type support was introduced (#10080), but only BTree or Hash were implemented.
Suggested solution
Allow GiST as an option to the type
parameter for an index.
Alternatives
This could be hacked in with an arbitrary migration, but that is not a clean solution.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:7 (5 by maintainers)
Top Results From Across the Web
15: 12.9. Preferred Index Types for Text Search - PostgreSQL
A GiST index is lossy, meaning that the index might produce false matches, and it is necessary to check the actual table row...
Read more >Indexes in PostgreSQL — 5 (GiST). In the previous ... - Medium
GiST is a height-balanced tree that consists of node pages. The nodes consist of index rows. Each row of a leaf node (leaf...
Read more >A guide to using Postgres indexes - The Quest Blog
The Generalized Search Tree (GiST) is balanced, and it implements indexing schemes for new data types in a familiar balanced tree structure. It ......
Read more >A tour of Postgres Index Types - Citus Data
GiST indexes have some more fixed constraints around size, whereas GIN indexes can become quite large. As a result, GiST indexes are lossy....
Read more >PostgreSQL Index Types
GiST stands for Generalized Search Tree. GiST indexes allow a building of general tree structures. GiST indexes are useful in indexing geometric data...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is now available in our
dev
version, so you can useprisma@dev
and theextendedIndexes
preview feature if you want to play with it. Optimally start with adb pull
on your existing database that uses these, and see if they are added correctly to the introspected schema. Afterwards you can also play with adding additional ones and then migrate (withdb push
ormigrate dev
).Let us know how it goes please!
Oh! Yeah - that’s because there are use cases (like mine) in which GiST index support alone would be enough to make Prisma usable without hacks. We can already specify geometry columns, but can’t load data into them until they have the right index type.