Re: varchar does not work too well with IS NOT NULL partial indexes.

From: "Dawid Kuroczko" <qnex42(at)gmail(dot)com>
To: "Gregory Stark" <stark(at)enterprisedb(dot)com>
Cc: "Postgres General" <pgsql-general(at)postgresql(dot)org>
Subject: Re: varchar does not work too well with IS NOT NULL partial indexes.
Date: 2007-07-24 15:19:25
Message-ID: 758d5e7f0707240819h37b7b937vd0839bd32c221717@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 7/24/07, Gregory Stark <stark(at)enterprisedb(dot)com> wrote:
> "Dawid Kuroczko" <qnex42(at)gmail(dot)com> writes:
>
> > Now, if we:
> >
> > # EXPLAIN ANALYZE SELECT t FROM foo WHERE t='X17';
> > QUERY PLAN
> > ---------------------------------------------------------------------------------------------------
> > Seq Scan on foo (cost=0.00..18025.78 rows=1 width=8) (actual
> > time=0.079..565.661 rows=1 loops=1)
> > Filter: ((t)::text = 'X17'::text)
> > Total runtime: 565.689 ms
> >
> >
> > # EXPLAIN ANALYZE SELECT t FROM foo WHERE t='X17';
> > QUERY PLAN
> > -------------------------------------------------------
> > Seq Scan on foo (cost=0.00..178.00 rows=50 width=68)
> > Filter: ((t)::text = 'X17'::text)
> > (2 rows)
>
> I still think you're playing games with the output. a) This is not an EXPLAIN
> ANALYZE at all, there are no "actual" values. And b) there's no explanation
> for why the estimates should be different for this query than the previous,
> identical, query.

My mistake, copy&paste error.

> Send along the actual psql session, not an edited version.

Actual session is attached.

If I may suggest it -- try to run the queries yourself. You will find
the problem
lies not in the statistics.

Regards,
Dawid

Attachment Content-Type Size
session.log application/octet-stream 1.7 KB

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2007-07-24 15:29:06 Re: Delete/update with limit
Previous Message Csaba Nagy 2007-07-24 14:55:32 Re: Delete/update with limit