paleolimbot commented on issue #1077:
URL: https://github.com/apache/sedona-db/issues/1077#issuecomment-5070036783

   The convex hull is used in the ORDER BY (area, I think) so it needs to get 
computed for all groups even though only 100 are returned.
   
   The spill probably happens on the ST_Collect_Agg...in the next version we 
can use ST_ConvexHull_Agg that was just added, where we can better enforce a 
memory limit (e.g., by periodically computing an convex hull and saving that as 
the aggregate state rather than saving all of the input and computing the 
convex hull at the end. Something else that may help is implementing a groups 
accumulator for ST_Collect_Agg (I think we only implement the regular one), but 
maybe not because that's designed to optimize for lots of tiny groups.
   
   We can also run `.explain()` to see if anything is funky with the plan.


-- 
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