pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Antonin Houska <ah@cybertec.at>
To: Aleksandr Parfenov <asp437@gmail.com>
Cc: a.bykov@postgrespro.ru
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: Optimze usage of immutable functions as relation
Date: Thu, 08 Nov 2018 15:08:03 +0100
Message-ID: <11120.1541686083@localhost> (raw)
In-Reply-To: <CACdpekK1oDy7-_HnXOaREa_8HM2r-fsp8iv5e6p8aWOdGdK8Mg@mail.gmail.com>
References: <402356c32eeb93d4fed01f66d6c7fe2d@postgrespro.ru>
	<20180906185109.661aaef0@asp437-ThinkPad-L380>
	<153994199621.10161.17815885396545049364.pgcf@coridan.postgresql.org>
	<CACdpekK1oDy7-_HnXOaREa_8HM2r-fsp8iv5e6p8aWOdGdK8Mg@mail.gmail.com>

Aleksandr Parfenov <asp437@gmail.com> wrote:

> I fixed a typo and some comments. Please find new version attached.

I've checked this verstion too.

* is_simple_stable_function()

instead of fetching HeapTuple from the syscache manually, you might want to
consider using functions from lsyscache.c (get_func_rettype, get_func_retset,
etc.), or adding a function that returns (subset of) the fields you need in a
single call.

* pull_up_simple_function():

As you assume that ret->functions is a single-item list

	Assert(list_length(rte->functions) == 1);

the following iteration is not necessary:

	foreach(lc, functions_list)

Also, there seems to be a lot of copy & paste from pull_up_simple_values(), so
some refactoring would make sense.


-- 
Antonin Houska
Cybertec Schönig & Schönig GmbH
Gröhrmühlgasse 26, A-2700 Wiener Neustadt
Web: https://www.cybertec-postgresql.com




view thread (29+ messages)  latest in thread

Message-ID: <11120.1541686083@localhost>
Permalink:  ../11120.1541686083@localhost/
Also on:    postgresql.org/message-id/11120.1541686083@localhost

 · 

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-hackers@postgresql.org
  Cc: ah@cybertec.at, asp437@gmail.com, a.bykov@postgrespro.ru, pgsql-hackers@lists.postgresql.org
  Subject: Re: Optimze usage of immutable functions as relation
  In-Reply-To: <11120.1541686083@localhost>

* 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