Kontinuation commented on code in PR #534:
URL: https://github.com/apache/sedona-db/pull/534#discussion_r2719816063


##########
rust/sedona-spatial-join/src/refine/tg.rs:
##########
@@ -267,6 +267,13 @@ impl IndexQueryResultRefiner for TgRefiner {
         }
     }
 
+    fn estimate_max_memory_usage(&self, build_stats: &GeoStatistics) -> usize {
+        // TODO: This is a rough estimate of the memory usage of the tg 
geometry and
+        // may not be accurate.
+        // https://github.com/apache/sedona-db/issues/281
+        build_stats.total_size_bytes().unwrap_or(0) as usize * 2

Review Comment:
   We prefer to estimate the memory needed without the overhead of creating tg 
geom for each geometry, so we calculated the estimated size instead of measure 
the real size.
   
   The estimation here is accurate enough in practice. I have also run some 
experiments using tg_geom_size to obtain a better formula for more accurate 
estimation. I'll submit a patch to refine this formula separately.



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