[openstreetmap/openstreetmap-website] Serve only trackable and identifiable points and add cursor pagination to the trackpoints API (PR #7322)

Tom Hughes notifications at github.com
Mon Aug 24 21:50:16 UTC 2026


tomhughes left a comment (openstreetmap/openstreetmap-website#7322)

I ran that on a production server, and the times are kind of variable:

```
Timing is on.
===== page 1 (no cursor) =====
Time: 7181.445 ms (00:07.181)
Timing is off.
Timing is on.
cursor for page 2: 12090423 0 '2025-08-21 16:20:59'
===== page 2 =====
Time: 6911.865 ms (00:06.912)
Timing is off.
Timing is on.
cursor for page 3: 11947724 0 '2025-01-08 17:11:09'
===== page 3 =====
Time: 129275.562 ms (02:09.276)
Timing is off.
Timing is on.
cursor for page 4: 11744046 0 '2024-08-21 16:36:25'
===== page 4 =====
Time: 356.327 ms
Timing is off.
Timing is on.
cursor for page 5: 11741941 0 '2024-08-21 07:57:49'
===== page 5 =====
Time: 1083.239 ms (00:01.083)
Timing is off.
Timing is on.
cursor for page 6: 11741828 0 '2024-08-20 07:21:21'
===== page 6 =====
Time: 7571.500 ms (00:07.571)
Timing is off.
Timing is on.
cursor for page 7: 11741133 0 '2024-08-19 17:49:06'
===== page 7 =====
Time: 14702.480 ms (00:14.702)
Timing is off.
Timing is on.
cursor for page 8: 11737857 0 '2024-08-18 17:29:39'
===== page 8 =====
Time: 371345.352 ms (06:11.345)
Timing is off.
Timing is on.
cursor for page 9: 11725028 0 '2024-05-12 14:45:00'
===== page 9 =====
Time: 55982.673 ms (00:55.983)
Timing is off.
Timing is on.
cursor for page 10: 11718378 0 '2024-05-10 10:43:07'
===== page 10 (full plan) =====
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 QUERY PLAN                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Limit  (cost=12175501.39..17007778264.07 rows=2794 width=44) (actual time=33434.039..77546.191 rows=5000 loops=1)
   Buffers: shared hit=11121113 read=1750612 dirtied=2 written=3
   ->  Gather Merge  (cost=12175501.39..17007778264.07 rows=2794 width=44) (actual time=33434.035..77545.713 rows=5000 loops=1)
         Workers Planned: 2
         Workers Launched: 2
         Buffers: shared hit=11121113 read=1750612 dirtied=2 written=3
         ->  Incremental Sort  (cost=12174501.36..17007776941.55 rows=1397 width=44) (actual time=31563.182..68221.341 rows=2152 loops=3)
               Sort Key: gps_points.gpx_id DESC, gps_points.trackid, gps_points."timestamp"
               Presorted Key: gps_points.gpx_id
               Full-sort Groups: 3  Sort Method: quicksort  Average Memory: 30kB  Peak Memory: 30kB
               Pre-sorted Groups: 4  Sort Method: quicksort  Average Memory: 77kB  Peak Memory: 117kB
               Buffers: shared hit=11121113 read=1750612 dirtied=2 written=3
               Worker 0:  Full-sort Groups: 6  Sort Method: quicksort  Average Memory: 30kB  Peak Memory: 30kB
                 Pre-sorted Groups: 5  Sort Method: quicksort  Average Memory: 169kB  Peak Memory: 719kB
               Worker 1:  Full-sort Groups: 4  Sort Method: quicksort  Average Memory: 30kB  Peak Memory: 30kB
                 Pre-sorted Groups: 4  Sort Methods: top-N heapsort, quicksort  Average Memory: 249kB  Peak Memory: 786kB
               ->  Nested Loop  (cost=1.35..17007776501.50 rows=1397 width=44) (actual time=20965.332..68217.735 rows=6354 loops=3)
                     Buffers: shared hit=11120929 read=1750612 dirtied=2 written=3
                     ->  Parallel Index Scan Backward using points_gpxid_idx on gps_points  (cost=0.92..17007770728.65 rows=2180 width=44) (actual time=2112.287..68102.921 rows=54748 loops=3)
                           Index Cond: (gpx_id <= 11718378)
                           Filter: (((latitude)::numeric >= 559500000.0) AND ((latitude)::numeric <= 564500000.0) AND ((longitude)::numeric >= 401000000.0) AND ((longitude)::numeric <= 406000000.0) AND ((gpx_id < 11718378) OR ((gpx_id = 11718378) AND ((trackid > 0) OR ((trackid = 0) AND ("timestamp" > '2024-05-10 10:43:07'::timestamp without time zone))))) AND (((tile >= '3539321102'::bigint) AND (tile <= '3539321103'::bigint)) OR ((tile >= '3539321114'::bigint) AND (tile <= '3539321115'::bigint)) OR ((tile >= '3539321118'::bigint) AND (tile <= '3539321119'::bigint)) OR ((tile >= '3539321124'::bigint) AND (tile <= '3539321127'::bigint)) OR ((tile >= '3539321132'::bigint) AND (tile <= '3539321151'::bigint)) OR ((tile >= '3539321162'::bigint) AND (tile <= '3539321163'::bigint)) OR ((tile >= '3539321166'::bigint) AND (tile <= '3539321167'::bigint)) OR ((tile >= '3539321178'::bigint) AND (tile <= '3539321179'::bigint)) OR ((tile >= '3539321182'::bigint) AND (tile <= '3539321215'::bigint)) OR ((tile >= '3539321220'::bigint) AND (tile <= '3539321223'::bigint)) OR ((tile >= '3539321228'::bigint) AND (tile <= '3539321247'::bigint)) OR ((tile >= '3539321252'::bigint) AND (tile <= '3539321255'::bigint)) OR ((tile >= '3539321260'::bigint) AND (tile <= '3539321343'::bigint)) OR ((tile >= '3539321604'::bigint) AND (tile <= '3539321607'::bigint)) OR ((tile >= '3539321612'::bigint) AND (tile <= '3539321631'::bigint)) OR ((tile >= '3539321636'::bigint) AND (tile <= '3539321639'::bigint)) OR ((tile >= '3539321644'::bigint) AND (tile <= '3539321727'::bigint)) OR ((tile >= '3539321732'::bigint) AND (tile <= '3539321735'::bigint)) OR ((tile >= '3539321740'::bigint) AND (tile <= '3539321759'::bigint)) OR ((tile >= '3539321764'::bigint) AND (tile <= '3539321767'::bigint)) OR ((tile >= '3539321772'::bigint) AND (tile <= '3539321855'::bigint)) OR ((tile >= '3539321866'::bigint) AND (tile <= '3539321867'::bigint)) OR ((tile >= '3539321870'::bigint) AND (tile <= '3539321871'::bigint)) OR ((tile >= '3539321882'::bigint) AND (tile <= '3539321883'::bigint)) OR ((tile >= '3539321886'::bigint) AND (tile <= '3539321919'::bigint)) OR ((tile >= '3539321930'::bigint) AND (tile <= '3539321931'::bigint)) OR ((tile >= '3539321934'::bigint) AND (tile <= '3539321935'::bigint)) OR ((tile >= '3539321946'::bigint) AND (tile <= '3539321947'::bigint)) OR ((tile >= '3539321950'::bigint) AND (tile <= '3539322111'::bigint)) OR ((tile >= '3539322122'::bigint) AND (tile <= '3539322123'::bigint)) OR ((tile >= '3539322126'::bigint) AND (tile <= '3539322127'::bigint)) OR ((tile >= '3539322138'::bigint) AND (tile <= '3539322139'::bigint)) OR ((tile >= '3539322142'::bigint) AND (tile <= '3539322175'::bigint)) OR ((tile >= '3539322186'::bigint) AND (tile <= '3539322187'::bigint)) OR ((tile >= '3539322190'::bigint) AND (tile <= '3539322191'::bigint)) OR ((tile >= '3539322202'::bigint) AND (tile <= '3539322203'::bigint)) OR ((tile >= '3539322206'::bigint) AND (tile <= '3539322879'::bigint)) OR ((tile >= '3539323140'::bigint) AND (tile <= '3539323143'::bigint)) OR ((tile >= '3539323148'::bigint) AND (tile <= '3539323167'::bigint)) OR ((tile >= '3539323172'::bigint) AND (tile <= '3539323175'::bigint)) OR ((tile >= '3539323180'::bigint) AND (tile <= '3539323263'::bigint)) OR ((tile >= '3539323268'::bigint) AND (tile <= '3539323271'::bigint)) OR ((tile >= '3539323276'::bigint) AND (tile <= '3539323295'::bigint)) OR ((tile >= '3539323300'::bigint) AND (tile <= '3539323303'::bigint)) OR ((tile >= '3539323308'::bigint) AND (tile <= '3539323391'::bigint)) OR ((tile >= '3539323652'::bigint) AND (tile <= '3539323655'::bigint)) OR ((tile >= '3539323660'::bigint) AND (tile <= '3539323679'::bigint)) OR ((tile >= '3539323684'::bigint) AND (tile <= '3539323687'::bigint)) OR ((tile >= '3539323692'::bigint) AND (tile <= '3539323775'::bigint)) OR ((tile >= '3539323780'::bigint) AND (tile <= '3539323783'::bigint)) OR ((tile >= '3539323788'::bigint) AND (tile <= '3539323807'::bigint)) OR ((tile >= '3539323812'::bigint) AND (tile <= '3539323815'::bigint)) OR ((tile >= '3539323820'::bigint) AND (tile <= '3539324927'::bigint)) OR ((tile >= '3539324938'::bigint) AND (tile <= '3539324939'::bigint)) OR ((tile >= '3539324942'::bigint) AND (tile <= '3539324943'::bigint)) OR ((tile >= '3539324954'::bigint) AND (tile <= '3539324955'::bigint)) OR ((tile >= '3539324958'::bigint) AND (tile <= '3539324991'::bigint)) OR ((tile >= '3539325002'::bigint) AND (tile <= '3539325003'::bigint)) OR ((tile >= '3539325006'::bigint) AND (tile <= '3539325007'::bigint)) OR ((tile >= '3539325018'::bigint) AND (tile <= '3539325019'::bigint)) OR ((tile >= '3539325022'::bigint) AND (tile <= '3539325183'::bigint)) OR ((tile >= '3539325194'::bigint) AND (tile <= '3539325195'::bigint)) OR ((tile >= '3539325198'::bigint) AND (tile <= '3539325199'::bigint)) OR ((tile >= '3539325210'::bigint) AND (tile <= '3539325211'::bigint)) OR ((tile >= '3539325214'::bigint) AND (tile <= '3539325247'::bigint)) OR ((tile >= '3539325258'::bigint) AND (tile <= '3539325259'::bigint)) OR ((tile >= '3539325262'::bigint) AND (tile <= '3539325263'::bigint)) OR ((tile >= '3539325274'::bigint) AND (tile <= '3539325275'::bigint)) OR ((tile >= '3539325278'::bigint) AND (tile <= '3539325951'::bigint)) OR ((tile >= '3539325962'::bigint) AND (tile <= '3539325963'::bigint)) OR ((tile >= '3539325966'::bigint) AND (tile <= '3539325967'::bigint)) OR ((tile >= '3539325978'::bigint) AND (tile <= '3539325979'::bigint)) OR ((tile >= '3539325982'::bigint) AND (tile <= '3539326015'::bigint)) OR ((tile >= '3539326026'::bigint) AND (tile <= '3539326027'::bigint)) OR ((tile >= '3539326030'::bigint) AND (tile <= '3539326031'::bigint)) OR ((tile >= '3539326042'::bigint) AND (tile <= '3539326043'::bigint)) OR ((tile >= '3539326046'::bigint) AND (tile <= '3539326207'::bigint)) OR ((tile >= '3539326218'::bigint) AND (tile <= '3539326219'::bigint)) OR ((tile >= '3539326222'::bigint) AND (tile <= '3539326223'::bigint)) OR ((tile >= '3539326234'::bigint) AND (tile <= '3539326235'::bigint)) OR ((tile >= '3539326238'::bigint) AND (tile <= '3539326271'::bigint)) OR ((tile >= '3539326282'::bigint) AND (tile <= '3539326283'::bigint)) OR ((tile >= '3539326286'::bigint) AND (tile <= '3539326287'::bigint)) OR ((tile >= '3539326298'::bigint) AND (tile <= '3539326299'::bigint)) OR ((tile >= '3539326302'::bigint) AND (tile <= '3539329023'::bigint)) OR ((tile >= '3539329284'::bigint) AND (tile <= '3539329287'::bigint)) OR ((tile >= '3539329292'::bigint) AND (tile <= '3539329311'::bigint)) OR ((tile >= '3539329316'::bigint) AND (tile <= '3539329319'::bigint)) OR ((tile >= '3539329324'::bigint) AND (tile <= '3539329407'::bigint)) OR ((tile >= '3539329412'::bigint) AND (tile <= '3539329415'::bigint)) OR ((tile >= '3539329420'::bigint) AND (tile <= '3539329439'::bigint)) OR ((tile >= '3539329444'::bigint) AND (tile <= '3539329447'::bigint)) OR ((tile >= '3539329452'::bigint) AND (tile <= '3539329535'::bigint)) OR ((tile >= '3539329796'::bigint) AND (tile <= '3539329799'::bigint)) OR ((tile >= '3539329804'::bigint) AND (tile <= '3539329823'::bigint)) OR ((tile >= '3539329828'::bigint) AND (tile <= '3539329831'::bigint)) OR ((tile >= '3539329836'::bigint) AND (tile <= '3539329919'::bigint)) OR ((tile >= '3539329924'::bigint) AND (tile <= '3539329927'::bigint)) OR ((tile >= '3539329932'::bigint) AND (tile <= '3539329951'::bigint)) OR ((tile >= '3539329956'::bigint) AND (tile <= '3539329959'::bigint)) OR ((tile >= '3539329964'::bigint) AND (tile <= '3539329965'::bigint)) OR ((tile >= '3539329968'::bigint) AND (tile <= '3539329977'::bigint)) OR ((tile >= '3539329980'::bigint) AND (tile <= '3539329981'::bigint)) OR ((tile >= '3539329984'::bigint) AND (tile <= '3539330025'::bigint)) OR ((tile >= '3539330028'::bigint) AND (tile <= '3539330029'::bigint)) OR ((tile >= '3539330032'::bigint) AND (tile <= '3539330041'::bigint)) OR ((tile >= '3539330044'::bigint) AND (tile <= '3539330045'::bigint)) OR ((tile >= '3539330048'::bigint) AND (tile <= '3539330729'::bigint)) OR ((tile >= '3539330732'::bigint) AND (tile <= '3539330733'::bigint)) OR ((tile >= '3539330736'::bigint) AND (tile <= '3539330745'::bigint)) OR ((tile >= '3539330748'::bigint) AND (tile <= '3539330749'::bigint)) OR ((tile >= '3539330752'::bigint) AND (tile <= '3539330793'::bigint)) OR ((tile >= '3539330796'::bigint) AND (tile <= '3539330797'::bigint)) OR ((tile >= '3539330800'::bigint) AND (tile <= '3539330809'::bigint)) OR ((tile >= '3539330812'::bigint) AND (tile <= '3539330813'::bigint)) OR ((tile >= '3539330816'::bigint) AND (tile <= '3539330985'::bigint)) OR ((tile >= '3539330988'::bigint) AND (tile <= '3539330989'::bigint)) OR ((tile >= '3539330992'::bigint) AND (tile <= '3539331001'::bigint)) OR ((tile >= '3539331004'::bigint) AND (tile <= '3539331005'::bigint)) OR ((tile >= '3539331008'::bigint) AND (tile <= '3539331049'::bigint)) OR ((tile >= '3539331052'::bigint) AND (tile <= '3539331053'::bigint)) OR ((tile >= '3539331056'::bigint) AND (tile <= '3539331065'::bigint)) OR ((tile >= '3539331068'::bigint) AND (tile <= '3539331069'::bigint)) OR ((tile >= '3539333120'::bigint) AND (tile <= '3539333801'::bigint)) OR ((tile >= '3539333804'::bigint) AND (tile <= '3539333805'::bigint)) OR ((tile >= '3539333808'::bigint) AND (tile <= '3539333817'::bigint)) OR ((tile >= '3539333820'::bigint) AND (tile <= '3539333821'::bigint)) OR ((tile >= '3539333824'::bigint) AND (tile <= '3539333865'::bigint)) OR ((tile >= '3539333868'::bigint) AND (tile <= '3539333869'::bigint)) OR ((tile >= '3539333872'::bigint) AND (tile <= '3539333881'::bigint)) OR ((tile >= '3539333884'::bigint) AND (tile <= '3539333885'::bigint)) OR ((tile >= '3539333888'::bigint) AND (tile <= '3539334057'::bigint)) OR ((tile >= '3539334060'::bigint) AND (tile <= '3539334061'::bigint)) OR ((tile >= '3539334064'::bigint) AND (tile <= '3539334073'::bigint)) OR ((tile >= '3539334076'::bigint) AND (tile <= '3539334077'::bigint)) OR ((tile >= '3539334080'::bigint) AND (tile <= '3539334121'::bigint)) OR ((tile >= '3539334124'::bigint) AND (tile <= '3539334125'::bigint)) OR ((tile >= '3539334128'::bigint) AND (tile <= '3539334137'::bigint)) OR ((tile >= '3539334140'::bigint) AND (tile <= '3539334141'::bigint)) OR ((tile >= '3539334144'::bigint) AND (tile <= '3539334825'::bigint)) OR ((tile >= '3539334828'::bigint) AND (tile <= '3539334829'::bigint)) OR ((tile >= '3539334832'::bigint) AND (tile <= '3539334841'::bigint)) OR ((tile >= '3539334844'::bigint) AND (tile <= '3539334845'::bigint)) OR ((tile >= '3539334848'::bigint) AND (tile <= '3539334889'::bigint)) OR ((tile >= '3539334892'::bigint) AND (tile <= '3539334893'::bigint)) OR ((tile >= '3539334896'::bigint) AND (tile <= '3539334905'::bigint)) OR ((tile >= '3539334908'::bigint) AND (tile <= '3539334909'::bigint)) OR ((tile >= '3539334912'::bigint) AND (tile <= '3539335081'::bigint)) OR ((tile >= '3539335084'::bigint) AND (tile <= '3539335085'::bigint)) OR ((tile >= '3539335088'::bigint) AND (tile <= '3539335097'::bigint)) OR ((tile >= '3539335100'::bigint) AND (tile <= '3539335101'::bigint)) OR ((tile >= '3539335104'::bigint) AND (tile <= '3539335145'::bigint)) OR ((tile >= '3539335148'::bigint) AND (tile <= '3539335149'::bigint)) OR ((tile >= '3539335152'::bigint) AND (tile <= '3539335161'::bigint)) OR ((tile >= '3539335164'::bigint) AND (tile <= '3539335165'::bigint)) OR ((tile >= '3550511114'::bigint) AND (tile <= '3550511115'::bigint)) OR ((tile >= '3550511118'::bigint) AND (tile <= '3550511119'::bigint)) OR ((tile >= '3550511130'::bigint) AND (tile <= '3550511131'::bigint)) OR ((tile >= '3550511134'::bigint) AND (tile <= '3550511167'::bigint)) OR ((tile >= '3550511178'::bigint) AND (tile <= '3550511179'::bigint)) OR ((tile >= '3550511182'::bigint) AND (tile <= '3550511183'::bigint)) OR ((tile >= '3550511194'::bigint) AND (tile <= '3550511195'::bigint)) OR ((tile >= '3550511198'::bigint) AND (tile <= '3550511359'::bigint)) OR ((tile >= '3550511370'::bigint) AND (tile <= '3550511371'::bigint)) OR ((tile >= '3550511374'::bigint) AND (tile <= '3550511375'::bigint)) OR ((tile >= '3550511386'::bigint) AND (tile <= '3550511387'::bigint)) OR ((tile >= '3550511390'::bigint) AND (tile <= '3550511423'::bigint)) OR ((tile >= '3550511434'::bigint) AND (tile <= '3550511435'::bigint)) OR ((tile >= '3550511438'::bigint) AND (tile <= '3550511439'::bigint)) OR ((tile >= '3550511450'::bigint) AND (tile <= '3550511451'::bigint)) OR ((tile >= '3550511454'::bigint) AND (tile <= '3550512127'::bigint)) OR ((tile >= '3550512138'::bigint) AND (tile <= '3550512139'::bigint)) OR ((tile >= '3550512142'::bigint) AND (tile <= '3550512143'::bigint)) OR ((tile >= '3550512154'::bigint) AND (tile <= '3550512155'::bigint)) OR ((tile >= '3550512158'::bigint) AND (tile <= '3550512191'::bigint)) OR ((tile >= '3550512202'::bigint) AND (tile <= '3550512203'::bigint)) OR ((tile >= '3550512206'::bigint) AND (tile <= '3550512207'::bigint)) OR ((tile >= '3550512218'::bigint) AND (tile <= '3550512219'::bigint)) OR ((tile >= '3550512222'::bigint) AND (tile <= '3550512383'::bigint)) OR ((tile >= '3550512394'::bigint) AND (tile <= '3550512395'::bigint)) OR ((tile >= '3550512398'::bigint) AND (tile <= '3550512399'::bigint)) OR ((tile >= '3550512410'::bigint) AND (tile <= '3550512411'::bigint)) OR ((tile >= '3550512414'::bigint) AND (tile <= '3550512447'::bigint)) OR ((tile >= '3550512458'::bigint) AND (tile <= '3550512459'::bigint)) OR ((tile >= '3550512462'::bigint) AND (tile <= '3550512463'::bigint)) OR ((tile >= '3550512474'::bigint) AND (tile <= '3550512475'::bigint)) OR ((tile >= '3550512478'::bigint) AND (tile <= '3550515199'::bigint)) OR ((tile >= '3550515210'::bigint) AND (tile <= '3550515211'::bigint)) OR ((tile >= '3550515214'::bigint) AND (tile <= '3550515215'::bigint)) OR ((tile >= '3550515226'::bigint) AND (tile <= '3550515227'::bigint)) OR ((tile >= '3550515230'::bigint) AND (tile <= '3550515263'::bigint)) OR ((tile >= '3550515328'::bigint) AND (tile <= '3550515392'::bigint)) OR ((tile >= '3550515712'::bigint) AND (tile <= '3550515776'::bigint)) OR ((tile >= '3550515840'::bigint) AND (tile <= '3550515904'::bigint)) OR ((tile >= '3550517248'::bigint) AND (tile <= '3550517312'::bigint)) OR ((tile >= '3550517376'::bigint) AND (tile <= '3550517440'::bigint)) OR ((tile >= '3550517760'::bigint) AND (tile <= '3550517824'::bigint)) OR ((tile >= '3550517888'::bigint) AND (tile <= '3550517952'::bigint)) OR ((tile >= '3550519296'::bigint) AND (tile <= '3550519977'::bigint)) OR ((tile >= '3550519980'::bigint) AND (tile <= '3550519981'::bigint)) OR ((tile >= '3550519984'::bigint) AND (tile <= '3550519993'::bigint)) OR ((tile >= '3550519996'::bigint) AND (tile <= '3550519997'::bigint)) OR ((tile >= '3550520000'::bigint) AND (tile <= '3550520041'::bigint)) OR ((tile >= '3550520044'::bigint) AND (tile <= '3550520045'::bigint)) OR ((tile >= '3550520048'::bigint) AND (tile <= '3550520057'::bigint)) OR ((tile >= '3550520060'::bigint) AND (tile <= '3550520061'::bigint)) OR ((tile >= '3550520064'::bigint) AND (tile <= '3550520233'::bigint)) OR ((tile >= '3550520236'::bigint) AND (tile <= '3550520237'::bigint)) OR ((tile >= '3550520240'::bigint) AND (tile <= '3550520249'::bigint)) OR ((tile >= '3550520252'::bigint) AND (tile <= '3550520253'::bigint)) OR ((tile >= '3550520256'::bigint) AND (tile <= '3550520297'::bigint)) OR ((tile >= '3550520300'::bigint) AND (tile <= '3550520301'::bigint)) OR ((tile >= '3550520304'::bigint) AND (tile <= '3550520313'::bigint)) OR ((tile >= '3550520316'::bigint) AND (tile <= '3550520317'::bigint)) OR ((tile >= '3550520320'::bigint) AND (tile <= '3550521001'::bigint)) OR ((tile >= '3550521004'::bigint) AND (tile <= '3550521005'::bigint)) OR ((tile >= '3550521008'::bigint) AND (tile <= '3550521017'::bigint)) OR ((tile >= '3550521020'::bigint) AND (tile <= '3550521021'::bigint)) OR ((tile >= '3550521024'::bigint) AND (tile <= '3550521065'::bigint)) OR ((tile >= '3550521068'::bigint) AND (tile <= '3550521069'::bigint)) OR ((tile >= '3550521072'::bigint) AND (tile <= '3550521081'::bigint)) OR ((tile >= '3550521084'::bigint) AND (tile <= '3550521085'::bigint)) OR ((tile >= '3550521088'::bigint) AND (tile <= '3550521257'::bigint)) OR ((tile >= '3550521260'::bigint) AND (tile <= '3550521261'::bigint)) OR ((tile >= '3550521264'::bigint) AND (tile <= '3550521273'::bigint)) OR ((tile >= '3550521276'::bigint) AND (tile <= '3550521277'::bigint)) OR ((tile >= '3550521280'::bigint) AND (tile <= '3550521321'::bigint)) OR ((tile >= '3550521324'::bigint) AND (tile <= '3550521325'::bigint)) OR ((tile >= '3550521328'::bigint) AND (tile <= '3550521337'::bigint)) OR ((tile >= '3550521340'::bigint) AND (tile <= '3550521341'::bigint)) OR ((tile >= '3550523392'::bigint) AND (tile <= '3550523456'::bigint)) OR ((tile >= '3550523520'::bigint) AND (tile <= '3550523584'::bigint)) OR ((tile >= '3550523904'::bigint) AND (tile <= '3550523968'::bigint)) OR ((tile >= '3550524032'::bigint) AND (tile <= '3550524073'::bigint)) OR ((tile >= '3550524076'::bigint) AND (tile <= '3550524077'::bigint)) OR ((tile >= '3550524080'::bigint) AND (tile <= '3550524089'::bigint)) OR ((tile >= '3550524092'::bigint) AND (tile <= '3550524093'::bigint)) OR (tile = ANY ('{3550515274,3550515296,3550515298,3550515304,3550515306,3550515394,3550515400,3550515402,3550515424,3550515426,3550515432,3550515434,3550515778,3550515784,3550515786,3550515808,3550515810,3550515816,3550515818,3550515906,3550515912,3550515914,3550515936,3550515938,3550515944,3550515946,3550517314,3550517320,3550517322,3550517344,3550517346,3550517352,3550517354,3550517442,3550517448,3550517450,3550517472,3550517474,3550517480,3550517482,3550517826,3550517832,3550517834,3550517856,3550517858,3550517864,3550517866,3550517954,3550517960,3550517962,3550517984,3550517986,3550517992,3550517994,3550523458,3550523464,3550523466,3550523488,3550523490,3550523496,3550523498,3550523586,3550523592,3550523594,3550523616,3550523618,3550523624,3550523626,3550523970,3550523976,3550523978,3550524000,3550524002,3550524008,3550524010,3550524096,3550524098,3550524104,3550524106,3550524128,3550524130,3550524136}'::bigint[]))))
                           Rows Removed by Filter: 216282942
                           Buffers: shared hit=10463955 read=1750612 dirtied=2 written=3
                     ->  Index Scan using gpx_files_pkey on gpx_files  (cost=0.43..2.65 rows=1 width=8) (actual time=0.002..0.002 rows=0 loops=164243)
                           Index Cond: (id = gps_points.gpx_id)
                           Filter: (visibility = ANY ('{trackable,identifiable}'::gpx_visibility_enum[]))
                           Rows Removed by Filter: 1
                           Buffers: shared hit=656974
 Planning:
   Buffers: shared hit=30
 Planning Time: 6.171 ms
 Execution Time: 77546.787 ms
(32 rows)

Time: 77557.367 ms (01:17.557)
```

The noticeable thing in the full plan is that it's not using the tile index at all, so it's effectively searching all traces  looking for geographic matches.

That might be rather different with the linestring version of course.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/7322#issuecomment-5401832127
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/7322/c5401832127 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260824/717b187f/attachment-0001.htm>


More information about the rails-dev mailing list