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
GiST penalty optimization for point strips #129
Conversation
2D improvement for #3753
Build failed, but it seems it failed not because of issues in the code but some builder configuration issues. |
@Komzpa I have a question, might be more my ignorance since I rarely look at gist code. If the issue you describe was fixed for cube, why do you not also have a patch for? gserialized_gist_nd.c |
I'll drop some info here.
|
@x4m thanks for the feedback. 1.5 or 3x still seems worthwhile though debating if I should just hold this for 2.4 (not backport to 2.3 since that should be focused more on bug fixes). So sounds like you think there is still worthwhile to have an nd fix too. @Komzpa you thinking of adding to this an nd? I'll test with this 2d first to make sure no surprises. |
@Komzpa I'll try to fix travis's build issues. In meantime, can you check on this issue. I get this when trying to compile against trunk. ` ` |
@robe2 1.5x and 3x was an improvement with old Guttman split algorithm. Since PostGIS is using one of the most advanced split algorithms, that split algorithm may be fixing data issues being solved by this patch. create extension if not exists cube; begin transaction; create table dataTable as select cube(array[x/1000,y/1000]) c from generate_series(1,1e3,1)x, generate_series(1,1e3,1) y; \timing select q,(select count(*) from dataTable dt where dt.c<@q) from (select cube(array[x,y],array[x+0.1,y+0.1]) q from (select random() x,random() y from generate_series(1,1e4,1) s0) s1) s2 ; select pg_size_pretty(pg_relation_size('idx')); drop table datatable; Replace cube with appropriate PostGIS type. Here we create grid of 1M points and do 10K searches in this grid. If search time is not reduced significantly, may be this trick is not usefull. |
Here's postgis version of @x4m 's code:
|
@robe2 ND committed, Travis builds successfully. |
@Komzpa I committed for trunk. I left the ticket open until I've done some speed testing. https://trac.osgeo.org/postgis/ticket/3753 Unfornately seems our github mirroring is broken at moment too. |
This trick doesn't seem useful based on my cursory tests. The index building took longer, size of index is the same, and no gain in performance. I tested PostGIS 2.3.2 on 9.6 64-bit window 7 and got these timings using @Komzpa tests and then repeated using PostGIS 2.4.0dev that has this patch. The index size are the same and don't see much of a difference in speed, but 2.4 seems slightly worse. Hard to tell absolutely with random data and I won't rule out cause is other changes in 2.4 code base, though I don't think we've touched the gist section except for this. Time 1: index build `PostGIS 2.3 test results: First run:
Second run:
Third run:
` PostGIS 2.4 results: `
Second run:
Third run:
` @Komzpa did you get a chance to test this? |
I'm reopening this since though I committed already seems to need further analysis and changes. @pramsey can you take this one over. Also see @x4m notes on the ticket - https://trac.osgeo.org/postgis/ticket/3753 |
Hi! Were there any decisions made? |
@x4m there were no discussions in IRC that I can see. |
We discussed at the sprint. @pramsey said he'd check it out further. |
I'm closing this out per x4m comment on - https://trac.osgeo.org/postgis/ticket/3753 that what has been committed is the best that can be done for now. |
2D improvement for #3753
Inspired by work of @x4m on improving penalty function for cubes.