h3-pg icon indicating copy to clipboard operation
h3-pg copied to clipboard

SP-GiST support

Open zachasme opened this issue 5 years ago • 4 comments
trafficstars

Replaces #7. Part of #5.

I have closed the old PR which contained code for both GiST and SP-GiST, splitting it into two separate PRs.

Currently the tests do not pass, and work is focused GiST, see #42.

zachasme avatar Aug 24 '20 14:08 zachasme

Hi! First and foremost, thank you for doing all this! It is really nice to have h3 integration in postgres :). I've been wondering that the h3 index structure fits perfectly the sp-gist indexes and found this PR. I tried to rebase this branch so it has the latest updates in main to give it a try and work on it. But it is a bit hell of a rebase :grin: and don't think I'm familiarized enough with your code to make it correctly. I feel weird asking you to rebase this so I can play around with the sp-gist thing (without any success I'm afraid) but it would be awesome if so happens! Thank you!

BielStela avatar Sep 29 '23 18:09 BielStela

Hi @BielStela! Any help on this is appreciated, I've gone ahead and rebased the branch on main.

You should be able to run the tests using the script at scripts/develop, and I've put some preliminary tests in h3/test/sql/opclass_spgist.sql.

As far as I can tell the last test query is currently crashing the server.

zachasme avatar Oct 02 '23 07:10 zachasme

Hi, @zachasme, I managed to pass all the test by finding that the line

https://github.com/zachasme/h3-pg/blob/e8aae9eeebb9b708ae3bb46e43e3b738542a3a2b/h3/src/opclass_spgist.c#L294

was the one causing the segfault. I removed the pointer definition and fixed pass by reference here and there of parent and test pass smoothly. The issue is that the index is as slow a not having the index so I think some deeper tweaks in the implementation are needed. I'm learning all this on the way so don't expect amazing news anytime soon :grimacing:

BielStela avatar Oct 10 '23 16:10 BielStela

Thank you for the fix!

Yes, I'm afraid the current branch is simply the result of me smashing something together that can run on a PostgreSQL server.

The next (big) step is figuring out how to best implement picksplit and choose, such that the implementation is both correct and performant.

May I ask how you tested that the index is as slow as not having the index?

zachasme avatar Oct 11 '23 07:10 zachasme