Skip site navigation (1) Skip section navigation (2)

Re: Index not used in functions in 7.0?

From: mig(at)utdt(dot)edu
To: tgl(at)sss(dot)pgh(dot)pa(dot)us
Cc: kyle(at)actarg(dot)com, pgsql-sql(at)postgresql(dot)org, merrill(at)actarg(dot)com
Subject: Re: Index not used in functions in 7.0?
Date: 2000-05-16 18:00:21
Message-ID: 200005161800.PAA21319@ant.utdt (view raw or flat)
Thread:
Lists: pgsql-sql
I am probably completely wrong, but at least it will be short ...

Could it be that
    select sum(tquant)
        from mtr_reg
        where to_proj = $2
        and pnum = $1
        and (status = 'clsd' or status = 'open' or status = 'prip')
    ;
makes it harder for the optimizer due to the ORs, and that
    select sum(tquant)
        from mtr_reg
        where to_proj = $2
        and pnum = $1
        and status in ('clsd','open','prip')
    --- last line changed
    ;
would produce a better cost estimate? 

Miguel Sofer


In response to

Responses

pgsql-sql by date

Next:From: Kyle BatemanDate: 2000-05-16 18:13:10
Subject: Re: Index not used in functions in 7.0?
Previous:From: Michael A. MayoDate: 2000-05-16 17:18:46
Subject: Re: What is the difference between NULL and "undef"

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group