question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support GiST Index type with Postgres

See original GitHub issue

Problem

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:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
janpiocommented, May 4, 2022

This is now available in our dev version, so you can use prisma@dev and the extendedIndexes preview feature if you want to play with it. Optimally start with a db 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 (with db push or migrate dev).

Let us know how it goes please!

1reaction
tmcwcommented, Mar 17, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found