[postgis-users] whats the different between ST_Extent() and ST_Estimated_Extent()

Nicolas Ribot nicolas.ribot at gmail.com
Mon Jun 28 05:35:16 PDT 2010


> Hi All,
>
> I have 2 queries:
> SELECT ST_Extent(point) FROM schema.mytable;
> SELECT ST_Estimated_Extent('schema', 'mytable', 'point');
>
> 2 queries above were returned for me same result (BOX2D):
> "BOX(11.1806726455688 55.3748893737793,24.1317653656006 67.8551025390625)"
> I don't know what is the different between 2 functions, should I use
> ST_Extent or ST_Estimated_Extent in this case.
> And ... Will be better, if you explain me when we need to use ST_Extent and
> when we need to use ST_Estimated_Extent  ;)
>

According to the doc, estimated_extent only looks at the table
statistics and does not compute the real extent of the column. (ie, if
stats are not up-to-date, the result may not be accurate).

Nicolas



More information about the postgis-users mailing list