Re: Trivial function query optimized badly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Craig A. James" <cjames@xxxxxxxxxxxxxxxx> 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


[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux