Re: question about indexing.

From: "Creager, Robert S" <CreagRS(at)LOUISVILLE(dot)STORTEK(dot)COM>
To: "'Doug McNaught'" <doug(at)wireboard(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: question about indexing.
Date: 2001-10-01 18:57:52
Message-ID: 10FE17AD5F7ED31188CE002048406DE8514EA9@lsv-msg06.stortek.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Hey Doug,

Hmmm... I just re-did two columns in a table from float4 from float8 'cause
the index was never used when executing a query. I'm guessing that the
values from the select were used as a float8 then? Thanks for the hint.

Later,
Rob

> -----Original Message-----
> From: Doug McNaught [mailto:doug(at)wireboard(dot)com]
> Sent: Sunday, September 30, 2001 7:36 PM
> To: Brian Hirt
> Cc: pgsql-general(at)postgresql(dot)org; Brian A Hirt
> Subject: Re: [GENERAL] question about indexing.
>
>
> "Brian Hirt" <bhirt(at)mobygames(dot)com> writes:
>
> > I have a table with about 1 million rows in it. One of the
> columns in this
> > table is some sort of status (it's an int2). Out of the
> million rows, only
> > about 100 of the rows have a status that is not like the rest.
>
> > Yes, i do vacuum the table.
> >
> > Does anyone know how to avoid all these table scans?
>
> Cast the value you're testing against in the query to int2
> and you may
> see an improvement. The planner isn't currently smart enough to
> realize it can use the index when the test value in the query is an
> int4.
>
> -Doug
> --
> In a world of steel-eyed death, and men who are fighting to be warm,
> Come in, she said, I'll give you shelter from the storm. -Dylan
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>

Browse pgsql-general by date

  From Date Subject
Next Message Cary Lewis 2001-10-01 19:35:09 windows ce version of postgresql
Previous Message Keary Suska 2001-10-01 18:49:23 Re: Extracting time