Re: Poor Plan selected w/ not provided a date/time but selecting date/time from a table

From: Ow Mun Heng <Ow(dot)Mun(dot)Heng(at)wdc(dot)com>
To: Richard Huxton <dev(at)archonet(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Poor Plan selected w/ not provided a date/time but selecting date/time from a table
Date: 2007-10-18 06:40:05
Message-ID: 1192689605.26528.5.camel@neuromancer.home.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Thu, 2007-10-18 at 07:28 +0100, Richard Huxton wrote:
> Ow Mun Heng wrote:
> > On Wed, 2007-10-17 at 20:37 +0100, Richard Huxton wrote:
> >> Your query plans don't seem to match your queries. That makes it
> >> difficult to provide meaningful advice.
> >
> > Well, then that makes both you and me(both) stumped. because the 2
> > queries are exactly the same except for the data part.
>
> Your queries were like this:
>
> > select
> > foo,
> > bar,
> > foobar
> > from
> > A,
> > join B
> > on a.id = b.id
> > join C
> > on c.id = b.id
> > and c.start_dtime = b.start_dtime
> > where audit_key_dtime >= '2007-08-08 18:00:00'
> > and audit_key_dtime < '2007-08-08 18:01:00'
and web_id <> 0

>
>
> Your plans contained these:
>
> > Filter: (pber_err_rate_hd_zn_2 <> 0::numeric)
>
> > Filter: (web_id <> 0::numeric)
>
> I don't see the <> 0 condition anywhere in your SQL - presumably there's
> a view involved somehwere?

My apologies, in an effort to disguise the column_names, I missed out
the 1st one.

There is no View it's just a filtering condition. Having said that, the
only difference between the 2 queries are just the dates. (or the way
the dates are provided to the query..)

In response to

Browse pgsql-general by date

  From Date Subject
Next Message postgresql.*.thewild 2007-10-18 07:06:17 Re: dblink and hostname resolution problem
Previous Message Richard Huxton 2007-10-18 06:31:18 Re: