pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Paragon Corporation <lr@pcorp.us>
To: 'David G. Johnston' <david.g.johnston@gmail.com>
To: 'Tom Lane' <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #12869: PostGIS 2.2 can't compile against 9.5 dev branch
Date: Sun, 22 Mar 2015 12:36:33 -0400
Message-ID: <000401d064be$5bfd11a0$13f734e0$@pcorp.us> (raw)
In-Reply-To: <CAKFQuwY-TgnXcYXpbQ0pa27VvE0RgGMw02krgXzSPDKevsWbng@mail.gmail.com>
References: <001c01d0647a$397bb260$ac731720$@pcorp.us>
	<CAKFQuwZtQxTcEQRpXk4Je9=1XSUSA40=BTi62M+GNH96P6dDgg@mail.gmail.com>
	<14130.1427035560@sss.pgh.pa.us>
	<CAKFQuwYeW417RRrq676xe5rSoJ2Qaf_D=DO=o_sNREvBDiLDRg@mail.gmail.com>
	<14986.1427037326@sss.pgh.pa.us>
	<CAKFQuwY-TgnXcYXpbQ0pa27VvE0RgGMw02krgXzSPDKevsWbng@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>


>While I trust your judgement actual knowledge is nice.  The fact that PostGIS is raising the complaint should make us rethink those assumptions; and nothing in their code or the minimal
> example strikes me as being improper.  That said, I am surprised you didn't recommend that the function should be moved to a FROM clause - though I believe the code could still optimize > that way without the offset 0.

> The PostGIS example involves constructing geometries from a definition.  I suspect that is not cheap, which suggests that maybe we could recommend increasing the cost of the function above
 > the default and refusing to flatten a function if the cost is sufficiently high?

Guys I tried increasing cost with the ST_Reclass function to 2000 and it didn't help.  The function is called for every single output.    The only thing that helps is setting this to VOLATILE as Tom suggests.  I guess we can do that as some sort of fix for these kinds of functions though I'm not sure if that would cause other issues.

> As for claiming that this is broken and should be reverted: nyet.  In the
> first place, there is certainly no PG documentation anywhere that promises
> single evaluation of a function written in the manner shown here.  

> But what does the typical user expect?  That should be the digested standard: whether it is documented should be secondary.  It is not documented that the given query will be multiply 

> evaluated either - and the fact that the query, as written, only include the function call once would suggest the user expect that it will only be evaluated once,

A good chunk of PostGIS functions are very costly and return a raster, geometry, geography object which is then further acted on in queries.  As David noted, the general user -- partly because of observation I guess assumed the behavior that a function such as that would only be called once.  I suppose if we were to change all such things to VOLATILE, that would be fine, but I'm concerned about the vast number of PostGIS users who further wrap the PostGIS functions and don't know to do this.
 

> I cannot help but feel there is a patch here that allows us to negate the regression while keeping the benefits - but it's beyond my skills to prove that let alone write it.

> David J.


Does this change affect any function that takes a complex object and then has that complex object return another complex object?  If that is the case, this would be disastrous for PostGIS users upgrading to 9.5 unless we change all the functions we have that have this behavior to VOLATILE.  I would be okay with that as long as it doesn't cause performance issues for older versions of PostgreSQL and doesn't cause performance issues elsewhere.


Thanks,
Regina



 





-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (13+ messages)  latest in thread

Message-ID: <000401d064be$5bfd11a0$13f734e0$@pcorp.us>
Permalink:  ../000401d064be$5bfd11a0$13f734e0$@pcorp.us/
Also on:    postgresql.org/message-id/000401d064be$5bfd11a0$13f734e0$@pcorp.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: lr@pcorp.us, david.g.johnston@gmail.com, tgl@sss.pgh.pa.us
  Subject: Re: BUG #12869: PostGIS 2.2 can't compile against 9.5 dev branch
  In-Reply-To: <000401d064be$5bfd11a0$13f734e0$@pcorp.us>
  References: <001c01d0647a$397bb260$ac731720$@pcorp.us> <CAKFQuwZtQxTcEQRpXk4Je9=1XSUSA40=BTi62M+GNH96P6dDgg@mail.gmail.com> <14130.1427035560@sss.pgh.pa.us> <CAKFQuwYeW417RRrq676xe5rSoJ2Qaf_D=DO=o_sNREvBDiLDRg@mail.gmail.com> <14986.1427037326@sss.pgh.pa.us> <CAKFQuwY-TgnXcYXpbQ0pa27VvE0RgGMw02krgXzSPDKevsWbng@mail.gmail.com> <000401d064be$5bfd11a0$13f734e0$@pcorp.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox