-
-
Notifications
You must be signed in to change notification settings - Fork 256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Safe GiST Index access #190
Comments
Hi @rapodaca ! There currently aren't nice APIs for that bit of functionality yet. :( If you do a Did you have something in particular you were hoping to do with it? Maybe some code you wish worked to help drive designs around possibly adding this? (If you'd like to add it, that'd also be great!) |
Thanks for the documentation tip. I can see things like I'd like to build an extension that can search chemical structures. These are essentially graphs that can be queried kind of like strings: by exact match (exact structure) or contains match (substructure/subgraph). The search is usually done in two passes:
I'm very experienced with the steps above (having written a lot of low-level code to do it), but very new to Postgres extensions, so I'm not sure how structure search would translate into Postgres indexes and types. There are examples of the kind of extension I'd like to build. A popular one is here: https://www.rdkit.org/docs/Cartridge.html It seems that GiST is the kind of index I want for this, based in part on how the above extension works. However, if btree could be made to work, I'd be interested in that as well. I'm not really clear on how a GiST index works. I was hoping it would be possible to play around with them in the context of some simple types before solving the main problem. So I any pointer to a simple "Hello World" thing I try out (if that's possible) would help a lot. |
That sounds really fun! Are you going to be using I noticed @Horusiath created https://github.com/Horusiath/gevel, maybe that's a good place to take a look for this? |
@Hoverbear thanks for mentioning. I'm working on adding the last bits to gevel from time to time, but 2/3 features for GiST indexes are there. Feel free to use them for reference. This however help with inspecting the indexes not building them. @rapodaca if you want to build your own indexed data type, be prepared for a bit of work. One thing is knowing how Postgres GiST works. Another is defining a set of several core functions that are necessary for Postgres to plugin your own indexing logic. I've started some work on that for my data type (vector versions), but it's also not finished. In short you should define several functions:
|
Thank you for this excellent project! I've started building extensions with pgx and writing about it here.
I noticed a pull request (#107) that mentions GIN and GiST.
Is the GiST index type currently available through pgx? If not, what would need to be put in place? If it is possible to use GIST, where can I find sample code and/or documentation?
The text was updated successfully, but these errors were encountered: