pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Christopher Kings-Lynne <chriskl@familyhealth.com.au>
To: David Teran <david.teran@cluster9.com>
Cc: PgSQL Performance ML <pgsql-performance@postgresql.org>
Subject: Re: speeding up a select with C function?
Date: Mon, 08 Mar 2004 09:29:19 +0800
Message-ID: <404BCC6F.5060903@familyhealth.com.au> (raw)
In-Reply-To: <7F2B9EA0-702C-11D8-9DA8-000A95C496AC@cluster9.com>
References: <7F2B9EA0-702C-11D8-9DA8-000A95C496AC@cluster9.com>

> explain analyze select
> ((t0.int_value-t1.int_value)*(t0.int_value-t1.int_value))
> from job_property t0, job_property t1
> where t0.id_job_profile = 5
> and t1.id_job_profile = 6
> and t1.id_job_attribute = t0.id_job_attribute
> and t1.int_value < t0.int_value;

Don't bother with C function, use SQL function instead.  You could get a 
50% speedup.

Chris



view thread (8+ messages)  latest in thread

Message-ID: <404BCC6F.5060903@familyhealth.com.au>
Permalink:  ../404BCC6F.5060903@familyhealth.com.au/
Also on:    postgresql.org/message-id/404BCC6F.5060903@familyhealth.com.au

 · 

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-performance@postgresql.org
  Cc: chriskl@familyhealth.com.au, david.teran@cluster9.com
  Subject: Re: speeding up a select with C function?
  In-Reply-To: <404BCC6F.5060903@familyhealth.com.au>
  References: <7F2B9EA0-702C-11D8-9DA8-000A95C496AC@cluster9.com> <404BCC6F.5060903@familyhealth.com.au>

* 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