Re: Lack of use of indexes

From: Don Isgitt <djisgitt(at)soundenergy(dot)com>
To: Doug McNaught <doug(at)mcnaught(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Lack of use of indexes
Date: 2002-11-22 17:15:49
Message-ID: 3DDE6645.7070405@soundenergy.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thanks, Doug for your very prompt reply. This newsgroup is wonderful.

It will take a while, but I will create the table with text fields to
see if that helps. The query with ...section='14' did not use the index.

Don

Doug McNaught wrote:

>Don Isgitt <djisgitt(at)soundenergy(dot)com> writes:
>
>>Hello.
>>
>>I have a question regarding the lack of use of indexes on a table; I
>>have included what I hope is all the relevant information. Your help
>>is appreciated.
>>
>
>Use "varchar" or "text" instead of "character" for your column types
>and it should work. IIRC, "character" is treated slightly differently
>from other text types in the query optimizer, and string constants
>default to type "text".
>
>As far as why the integer index isn't being used, I'm not sure. Does
>it use the index if you change the WHERE clase to " section = '14' "?
>
>-Doug
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message snpe 2002-11-22 17:30:35 Re: Question about DEADLOCK
Previous Message Dave [Hawk-Systems] 2002-11-22 17:12:50 caveats upgrading from 7.0.3 to 7.2.x