Skip to content

Eliminate Unused Response Artifacts #7

@DurstDog87

Description

@DurstDog87

Problem:

geom is required by ST_AsMVTGeom to create an envelope from which to form tiles. However, geom then remains as an artifact in the query output sent out to the client.

Example:

WITH mvtgeom AS (
            SELECT ST_AsMVTGeom(ST_Transform(geom, 3857), ST_TileEnvelope(
                    1,1,1
                )) AS mvtgeom, *
            FROM (SELECT gid, geom FROM sch.table) AS dat --geom included in query is used by ST_AsMVTGeom
            WHERE ST_Intersects(geom, ST_Transform(ST_TileEnvelope(
                    1,1,1
            ), 4269))
        )
        SELECT ST_AsMVT(mvtgeom.*) AS mvt FROM mvtgeom; --geom included in output tuple

resulting output tuple will include both gid and geom [(<gid>, <geom>), ...]. This means more bytes sent to the client, even if they are never used.

Solution:

  • eliminate geom from output? How? But then how do we add it back if it is actually wanted?
  • leave as is? But then we are potentially sending more data to the client than is actually needed.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingquestionFurther information is requested

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions