Re: BIGINT indexes still with problems

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Dan Ruthers <dan211a(at)lycos(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: BIGINT indexes still with problems
Date: 2004-08-10 19:28:13
Message-ID: 20040810122707.M83467@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Mon, 9 Aug 2004, Dan Ruthers wrote:

> Now, if I run this query (note the int8 cast - also tried with the '' cast to String, same results):
> test=> explain select * from dmaildatum where idparent=int8(783219);
> QUERY PLAN
> ------------------------------------------------------------------
> Seq Scan on dmaildatum (cost=0.00..2241.71 rows=2229 width=272)
> Filter: (idparent = 783219::bigint)
> (2 rows)
>
> The index is not used. But with an identical query, only different parameter value:
> desknow=> explain select * from dmaildatum where idparent=int8(1187838);
> QUERY PLAN
>
> --------------------------------------------------------------------------------
> ---------------
> Index Scan using ix_dmaildatum_idparent on dmaildatum (cost=0.00..284.05 rows=
> 102 width=272)
> Index Cond: (idparent = 1187838::bigint)
> (2 rows)

Look at the row estimates for the two cases. How many rows are actually
returned and how long the queries take (explain analyze will give that
information)?

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Robert L Mathews 2004-08-10 19:42:59 Re: PostgreSQL 8.0 Feature List?
Previous Message Peter Eisentraut 2004-08-10 19:25:53 Re: BIGINT indexes still with problems