pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Craig A. James <cjames@modgraph-usa.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Trivial function query optimized badly
Date: Thu, 04 Jan 2007 00:46:50 -0500
Message-ID: <12930.1167889610@sss.pgh.pa.us> (raw)
In-Reply-To: <459C705C.1060803@modgraph-usa.com>
References: <459C705C.1060803@modgraph-usa.com>

"Craig A. James" <cjames@modgraph-usa.com> writes:
>   CREATE OR REPLACE FUNCTION cansmiles(text) RETURNS text
>   AS '/usr/local/pgsql/lib/libchem.so', 'cansmiles'
>   LANGUAGE 'C' STRICT IMMUTABLE;

Umm ... this is a single-argument function.

> db=> explain analyze select version_id, 'Brc1ccc2nc(cn2c1)C(=O)O' from version where version.isosmiles = cansmiles('Brc1ccc2nc(cn2c1)C(=O)O', 1);

And this query is invoking some other, two-argument function; which
apparently hasn't been marked IMMUTABLE, else it'd have been folded
to a constant.

			regards, tom lane



view thread (5+ messages)  latest in thread

Message-ID: <12930.1167889610@sss.pgh.pa.us>
Permalink:  ../12930.1167889610@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/12930.1167889610@sss.pgh.pa.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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, cjames@modgraph-usa.com
  Subject: Re: Trivial function query optimized badly
  In-Reply-To: <12930.1167889610@sss.pgh.pa.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