<div dir="ltr"><div dir="ltr">Hi Daniel,<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il giorno ven 22 gen 2021 alle ore 18:07 Daniel Baston <<a href="mailto:dbaston@gmail.com">dbaston@gmail.com</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>It should be deterministic for most real data if the inputs are ordered consistently, using the OVER() clause as you suggest. It's possible that there may be a contrived situation involving duplicates in the input where a result would be different (as GEOS STRtree is using std::sort instead of std::stable_sort), but I'm not sure. Also, there are sometimes multiple possible clusterings that satisfy the DBSCAN algorithm, so it is expected that the results may differ from different implementations or different orderings of the same input.</div></div></blockquote><div><br></div><div>Thank you for the answer. I think I'll try to define the partition with the <span style="font-family:monospace">ORDER BY geom</span> clause in order to check if I can obtain more determinism. If I correctly understood, the <span style="font-family:monospace">ORDER BY</span> should add a further step with preordering the geometries using an Hilbert curve. Of course, this would impact the overall duration of the query.</div><div><br></div><div>Giuseppe.<br></div></div></div>