You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2020/12/18 21:59:02 UTC

[GitHub] [incubator-superset] betodealmeida edited a comment on pull request #12130: feat: estimate query cost in Postgres

betodealmeida edited a comment on pull request #12130:
URL: https://github.com/apache/incubator-superset/pull/12130#issuecomment-748339608


   > What's the unit of this cost? Seconds?
   
   > The costs are measured in arbitrary units determined by the planner's cost parameters (see Section 18.7.2). Traditional practice is to measure the costs in units of disk page fetches; that is, seq_page_cost is conventionally set to 1.0 and the other cost parameters are set relative to that. The examples in this section are run with the default cost parameters. [[reference](https://www.postgresql.org/docs/9.4/using-explain.html)]
   
   It's a relative value, so not super useful. But it's possible to collect stats about queries, and define a custom `QUERY_COST_FORMATTERS_BY_ENGINE` that maps from the relative values to something else. For example, you could run `EXPLAIN` every day in all recent queries, and use the results to built a histogram, so that the formatter says something like "this query is at the top 3% percentile of all queries".


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org