paleolimbot commented on PR #510:
URL: https://github.com/apache/sedona-db/pull/510#issuecomment-3755349902

   For this particular example (ST_Envelope) it's hugely beneficial:
   
   ```python
   import sedona.db
   
   sd = sedona.db.connect()
   
   # 10 million points
   sd.sql("""SELECT * FROM sd_random_geometry('{"target_rows": 
10000000}')""").to_memtable().to_view("pts")
   
   # pip install --pre --force-reinstall sedonadb 
--extra-index-url=https://repo.fury.io/sedona-nightlies/
   %time sd.sql("""SELECT ST_Envelope_Agg(geometry) as e FROM pts GROUP BY id % 
1000""").execute()
   %time sd.sql("""SELECT ST_Envelope_Agg(geometry) as e FROM pts GROUP BY id % 
10000""").execute()
   %time sd.sql("""SELECT ST_Envelope_Agg(geometry) as e FROM pts GROUP BY id % 
100000""").execute()
   #> CPU times: user 885 ms, sys: 29.9 ms, total: 915 ms
   #> Wall time: 95.7 ms
   #> CPU times: user 1.03 s, sys: 13.5 ms, total: 1.04 s
   #> Wall time: 99.2 ms
   #> CPU times: user 15.8 s, sys: 146 ms, total: 15.9 s
   #> Wall time: 1.44 s
   
   # pip install python/sedonadb
   %time sd.sql("""SELECT ST_Envelope_Agg(geometry) as e FROM pts GROUP BY id % 
1000""").execute()
   %time sd.sql("""SELECT ST_Envelope_Agg(geometry) as e FROM pts GROUP BY id % 
10000""").execute()
   %time sd.sql("""SELECT ST_Envelope_Agg(geometry) as e FROM pts GROUP BY id % 
100000""").execute()
   #> CPU times: user 283 ms, sys: 34.6 ms, total: 317 ms
   #> Wall time: 43.1 ms
   #> CPU times: user 238 ms, sys: 7.81 ms, total: 246 ms
   #> Wall time: 25.7 ms
   #> CPU times: user 407 ms, sys: 58 ms, total: 465 ms
   #> Wall time: 44.5 ms
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to