pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: WIP: Faster Expression Processing v4
Date: Thu, 23 Mar 2017 17:40:55 -0400
Message-ID: <8011.1490305255@sss.pgh.pa.us> (raw)
In-Reply-To: <20170323174004.a2ez7kygx5ngqxlp@alap3.anarazel.de>
References: <fcdaa51b-e905-72e0-39dd-5e22f535a253@2ndquadrant.com>
	<20170314065259.ffef4tfhgbsaieoe@alap3.anarazel.de>
	<69b7bb0e-8dab-3d39-1a89-3c6ab6409f64@iki.fi>
	<20170314224706.nxvtapenky6eom3z@alap3.anarazel.de>
	<13062.1489622943@sss.pgh.pa.us>
	<20170320062511.hp5qeurtxrwsvfxr@alap3.anarazel.de>
	<31150.1490193666@sss.pgh.pa.us>
	<20170322145240.vt2iolwt6vpmx33z@alap3.anarazel.de>
	<31922.1490194838@sss.pgh.pa.us>
	<28270.1490289299@sss.pgh.pa.us>
	<20170323174004.a2ez7kygx5ngqxlp@alap3.anarazel.de>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Stylistic thought ... I am wondering if it wouldn't be a good idea
to replace EEOP_CASE_WHEN_STEP, EEOP_CASE_THEN_STEP, EEOP_COALESCE,
and EEOP_ARRAYREF_CHECKINPUT with instructions defined in a less
usage-dependent way as

	EEOP_JUMP		unconditional jump
	EEOP_JUMP_IF_NULL	jump if step result is null
	EEOP_JUMP_IF_NOT_NULL	jump if step result isn't null
	EEOP_JUMP_IF_NOT_TRUE	jump if step result isn't TRUE

One could imagine later filling out this set with the other BoolTest
condition types, but that seems to be all we need right now.

These are basically just renamings of the step types that exist now,
although EEOP_ARRAYREF_CHECKINPUT would have to drop its not-very-
necessary Assert(!op->d.arrayref.state->isassignment).  Well, I guess
I should say that they're renamings of the semantics that I have
for these steps in my working copy; for instance, I got rid of
casewhen.value/casewhen.isnull in favor of letting CASE WHEN expressions
evaluate into the CASE's final output variable.

At least to me, I think the compiling code would be more readable
this way.  I find WHEN_STEP and THEN_STEP a bit odd because they are
emitted after, not before, the expressions you'd think they control.
ARRAYREF_CHECKINPUT is pretty vaguely named, too.

			regards, tom lane


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



view thread (107+ messages)  latest in thread

Message-ID: <8011.1490305255@sss.pgh.pa.us>
Permalink:  ../8011.1490305255@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/8011.1490305255@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-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, andres@anarazel.de, hlinnaka@iki.fi, tomas.vondra@2ndquadrant.com
  Subject: Re: WIP: Faster Expression Processing v4
  In-Reply-To: <8011.1490305255@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