<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
On 5/6/2016 11:10 AM, Sandro Santilli wrote:<br>
<blockquote cite="mid:20160506181047.GA27838@localhost" type="cite">
<pre wrap="">My concern is that the same function (say ST_Buffer) may cost very
few cycles or a lot of cycle depending on the input (a point vs. a
line with hundreds or thousand of vertices). I guess this is a common
problem with variable-size types.</pre>
</blockquote>
<br>
Not just variable size types, but functions where the cost depends
on the input. ST_Buffer(geom, 10) is much more expensive than
ST_Buffer(geom, 0), and I could probably make it an order of
magnitude more expensive with suitable parameters.<br>
<br>
Once 9.6 lands and these parameters start to matter more, we can see
if it's best to have a cost from the low or high end of the possible
range.<br>
<br>
<blockquote cite="mid:20160506181047.GA27838@localhost" type="cite">
<pre wrap="">I wonder if it would make sense to have the work you did packaged
as an extention to run on the <b class="moz-txt-star"><span class="moz-txt-tag">*</span>real<span class="moz-txt-tag">*</span></b> data for a given database
and tweak costs accordingly.</pre>
</blockquote>
<br>
It's difficult to do this. It requires an idle system, a dataset
that can be entirely CPU bound, and a fair amount of time to run.
Given how few people tune the cost GUCs, I don't think this is worth
it.<br>
</body>
</html>