Re: Rewriting using rules for performance

From: Matthew Wakeling
Subject: Re: Rewriting using rules for performance
Date: ,
Msg-id: alpine.DEB.2.00.0904031450190.21772@aragorn.flymine.org
(view: Whole thread, Raw)
In response to: Re: Rewriting using rules for performance  (Robert Haas)
List: pgsql-performance

Tree view

Rewriting using rules for performance  (Matthew Wakeling, )
 Re: Rewriting using rules for performance  (Robert Haas, )
  Re: Rewriting using rules for performance  (Matthew Wakeling, )
 Re: Rewriting using rules for performance  (Merlin Moncure, )
  Re: Rewriting using rules for performance  (Merlin Moncure, )

On Fri, 3 Apr 2009, Robert Haas wrote:
> On the other hand, the query planner should be figuring out which
> index to use without any help from you.  If it's not, something is
> wrong.

Unfortunately it cannot tell that

SELECT l1.id AS id1, l2.id AS id2 FROM location l1, location l2
WHERE l1.start <= l2.end AND l2.start <= l1.end

is the same as

SELECT l1.id AS id1, l2.id AS id2 FROM location l1, location l2
WHERE bioseg_create(l1.start, l1.end) && bioseg_create(l2.start, l2.end)

which is also the same as

SELECT * from do_overlaps() AS (id1 int, id2 int)

But thanks for clarifying the rule thing for me.

Matthew

--
 The email of the species is more deadly than the mail.


pgsql-performance by date:

From: David Kerr
Date:
Subject: Question on pgbench output
From: Tom Lane
Date:
Subject: Re: Question on pgbench output