Skip to content
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

For --auto-bounds quick, use ST_EstimatedExtent instead of ST_Extent for quicker results #1206

Open
nyurik opened this issue Feb 21, 2024 · 3 comments · May be fixed by #1220
Open

For --auto-bounds quick, use ST_EstimatedExtent instead of ST_Extent for quicker results #1206

nyurik opened this issue Feb 21, 2024 · 3 comments · May be fixed by #1220
Labels
enhancement good first issue pg Related to PostgreSQL sources

Comments

@nyurik
Copy link
Member

nyurik commented Feb 21, 2024

Modify PG querying to use a quicker extent function when the bound check is set to quick

Implementation is easy: simply add another bool param to calc_bounds, and use a different function depending on that param

async fn calc_bounds(

@nyurik nyurik added enhancement good first issue pg Related to PostgreSQL sources labels Feb 21, 2024
@sharkAndshark
Copy link
Collaborator

sharkAndshark commented Feb 26, 2024

WHEN (SELECT ST_GeometryType(rb) FROM real_bounds LIMIT 1) = 'ST_Point'

I'm a little bit confused. Could ST_SetSRID(ST_GeometryType(ST_EXTENT(geom)),srid) be st_point? Seems always St_Polygon?

@nyurik
Copy link
Member Author

nyurik commented Feb 26, 2024

@sharkAndshark this was done in #300 by @HackJack-101 a while ago, addressing bug #299. I may need to dig deeper though to understand why it was done

@sharkAndshark
Copy link
Collaborator

sharkAndshark commented Feb 28, 2024

I made a test on a point table which has only one point. And seems that St_EstimatedExtent has fixed it. @nyurik

SELECT
	st_geometrytype ( ST_SetSRID ( ST_Extent ( geom ), 4544 ) ) AS type1,
	st_geometrytype ( ST_Extent ( geom ) ) AS type2 ,
	st_geometrytype(  ST_EstimatedExtent('public','project_copy1','geom')) as type3
FROM
	project_copy1
-- 	type1: ST_Point  type2: ST_Point   type3: ST_Polygon

@sharkAndshark sharkAndshark linked a pull request Feb 29, 2024 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement good first issue pg Related to PostgreSQL sources
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants