pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Greg Stark <gsstark@mit.edu>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Rafael Martinez Guerrero <r.m.guerrero@usit.uio.no>
Cc: pgsql-performance@postgresql.org
Subject: Re: Help with optimizing a sql statement
Date: 10 Feb 2006 01:05:42 -0500
Message-ID: <87zmkz6955.fsf@stark.xeocode.com> (raw)
In-Reply-To: <5731.1139527320@sss.pgh.pa.us>
References: <1139497827.25608.1014.camel@bbking.uio.no>
	<5731.1139527320@sss.pgh.pa.us>

Tom Lane <tgl@sss.pgh.pa.us> writes:

> Are you sure this WHERE clause really expresses your intent?  It seems
> awfully oddly constructed.  Removing the redundant parens and clarifying
> the layout, I get
...
> That next-to-last major AND clause seems a rather unholy mix of join and
> restriction clauses; I wonder if it's not buggy in itself.  

FYI RT uses a perl module called SearchBuilder which constructs these queries
dynamically. So he's probably not really free to fiddle with the query all he
wants.

At the very least I would suggest checking the changelog for SearchBuilder for
more recent versions. There have been a lot of tweaks for working with
Postgres. In the past it really only worked properly with MySQL.

-- 
greg




view thread (9+ messages)

Message-ID: <87zmkz6955.fsf@stark.xeocode.com>
Permalink:  ../87zmkz6955.fsf@stark.xeocode.com/
Also on:    postgresql.org/message-id/87zmkz6955.fsf@stark.xeocode.com

 · 

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: gsstark@mit.edu, tgl@sss.pgh.pa.us, r.m.guerrero@usit.uio.no
  Subject: Re: Help with optimizing a sql statement
  In-Reply-To: <87zmkz6955.fsf@stark.xeocode.com>

* 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