Slow loading of table with large geometry objects
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 485
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Description
I have a table with 37 rows, each with a fairly large geometry. If I SELECT * FROM _table_ it takes about 15s, but if I simply load the table from the Postico browser it takes more than 30s.
My guess is that Postico is selecting the geometry ST_AsEWKT(), which is slowing the query down. If I SELECT *, ST_AsEWKT(geom) FROM _table_ the query takes approximately as long as Postico takes to load it.
I can see a few different solutions to this problem:
- Simply select the binary geometry
- If the geometry is requested and not transformed (either as a part of
*orSELECT geom), return some sort of placeholder. Perhaps something like<Geometry> - Similar to number 2, but return the type of geometry with
SELECT GeometryType(geom)
Thank you for creating such a great product!
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported timing difference between SELECT * and Postico's table loading, focusing on queries involving ST_AsEWKT(geom), binary geometry, and GeometryType(geom). Trace the table-browser query path in the Postico codebase; done means large-geometry tables load without the reported slowdown while preserving useful geometry display behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgresql, python
- Domain
- database
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100