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` offline 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". We had this running at Lyft for Presto, and we would show wall time, dollar cost and carbon footprint this way. ---------------------------------------------------------------- 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: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
