Opened 5 years ago
Closed 5 years ago
#4450 closed enhancement (fixed)
Speed up ST_GeometryType by avoiding strncat calls
Reported by: | Algunenano | Owned by: | Algunenano |
---|---|---|---|
Priority: | medium | Milestone: | PostGIS 3.0.0 |
Component: | postgis | Version: | master |
Keywords: | Cc: |
Description
ST_GeometryType
is currently doing 2 strncat calls which aren't necessary since the output is always the same and can be stored statically.
Performance difference:
Select ST_GeometryType(the_geom_webmercator) from benchmark_7773a711c8441d4b494a51fd9feebeac7a9b9c734619398620293;
Before:
number of transactions actually processed: 407 latency average = 296.925 ms tps = 13.471411 (including connections establishing) tps = 13.474553 (excluding connections establishing)
Using a static char:
number of transactions actually processed: 437 latency average = 275.895 ms tps = 14.498272 (including connections establishing) tps = 14.501781 (excluding connections establishing)
10% ain't much, but it's honest work
Note:
See TracTickets
for help on using tickets.
PR in https://github.com/postgis/postgis/pull/434