Uploaded image for project: 'Apache Sedona'
  1. Apache Sedona
  2. SEDONA-206

Performance regression of ST_Transform in 1.3.0-incubating

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.3.0
    • 1.3.1

    Description

      The performance of ST_Transform drastically degraded since 1.3.0. This is the flamegraph of an executor node when running queries like this:

      SELECT COUNT(1) FROM ms_buildings WHERE ST_Transform(ST_FlipCoordinates(geom), 'epsg:4326', 'epsg:3857') is not NULL
      

      The performance regression is caused by the introduction of custom CRS support. As we can see, most of the time was spent by exception handlers in geotools-referencing module. It is a very common use case to specify a well known CRS when calling ST_Transform, and we don't want to suffer from such a performance hit when doing that. One approach to fix this problem is to detect if the CRS string "looks like" a well known CRS by pattern matching before calling the expensive CRS.parseWKT.

      Attachments

        1. image-2022-12-02-18-55-39-236.png
          490 kB
          Kristin Cowalcijk

        Issue Links

          Activity

            People

              Unassigned Unassigned
              kontinuation Kristin Cowalcijk
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m