Re: [GENERAL] Re: can't seem to use index

From: Frank Mandarino <fam(at)risca(dot)com>
To: admin <admin(at)wtbwts(dot)com>
Cc: pgsql-general(at)postgreSQL(dot)org
Subject: Re: [GENERAL] Re: can't seem to use index
Date: 2000-01-11 17:45:16
Message-ID: 00Jan11.124518est.115201@sky.risca.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, 11 Jan 2000, admin wrote:

> > > I'm trying to use an index on a varchar(32) field, but explain keeps
> > > retuning a sequential scan. This is my table and index:
> >
> > I had a similar problem last year when trying to use an index on a
> > char(8) field. Two solutions worked for me: 1) use "bpchar_ops", and
> > 2) leave out the operator class altogether.
> >
> Thanks, it worked. After reading your previous message, I guess I will
> omit the operator class altogether considering postgresql will most likely
> make a better decision than me anyways.
>
> Furthermore, since you seem to be quite familiar with this project, are
> you aware of any documentation for fine tuning postgresql? For instance,
> how can I make an educated decition whether to use char(32) or
> varchar(32)? From the documentation, under /docs/user/datatype960.htm, all
> four character types are shown in a table but there's no explanation as to
> which would be preferable in certain situations. If using explain is the
> way to go, it returned a higher cost for a sequential scan on a char()
> field compared to a varchar() field. Unfortunately, I suspect using char()
> does have some advantages I don't know about.
>
> Maybe these are newbie preoccupations, but I suspect there are a few of us
> out there. For the moment, the best tips I've received came from this
> mailing list and maybe this is the way to go.
>
> Thanks again for the help,
> Marc
>

Marc,

I am happy to hear that the index is working, but I really can't take
any credit. I was only passing on information that I gained from these
mailing lists because I was in a similar situation once and I greatly
appreciated the help provided by Herouth Maoz and Gene Selkov, Jr.

Also, I am not that familiar with this project, so I don't have any fine
tuning suggestions for you. If you do find out any information about
the advantages of each of the character types, I'm sure it would be
useful to many subscribers of this list, including myself.

Regards,
../fam
--
Frank A. Mandarino
fam(at)risca(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Eckermann 2000-01-11 17:53:54 Memory leak in FreeBSD?
Previous Message Sarah Officer 2000-01-11 17:07:37 views containing agregates questions