[postgis-users] How to estimate the time taken for a query plan without actually running it?

Shaozhong SHI shishaozhong at gmail.com
Mon Aug 3 09:23:52 PDT 2020


On Mon, 3 Aug 2020 at 17:12, <ruvenml at beamerbrooks.com> wrote:

>
> In a word, no.  Unless the query returns a constant value, the run time
> will depend on the values of the data and on what machine it's being run on
> and the easiest way to determine those things are to actually run the query.
>
> If what you want is guidance about which queries are going to need
> optimization, the cost output from the EXPLAIN command will probably tell
> you where to spend your time.  The cost output will also tell you whether
> you have succeeded in improving the relative performance of a query without
> actually having to run it.
>
> Ruven Brooks
> On 8/3/2020 9:56 AM, Shaozhong SHI wrote:
>
> Hi,
>
> I tried to use "explain" to look into the query plan.  It only gives me
> the cost and rows, and does not give an estimate of time to run the query.
>
> "Explain analyze" gives an estimate of time needed, but for a Big Data
> query, one has to wait to get an answer,
>
> Is there a way to get an estimate of time for running a query, without
> actually running it.
>
> Looking forward to hearing from you.
>
> Regards,
>
> Shao
>
> _______________________________________________
> postgis-users mailing listpostgis-users at lists.osgeo.orghttps://lists.osgeo.org/mailman/listinfo/postgis-users
>
> Hi, Ruven,
>

Thanks for your tips.

Can you please expand on how to understand and use cost output?  My brain
seems to understand time taken, and can not get around with this cost
output.

Regards,

Shao

> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20200803/f39a4236/attachment.html>


More information about the postgis-users mailing list