From: | admin <admin(at)wtbwts(dot)com> |
---|---|
To: | Frank Mandarino <fam(at)risca(dot)com> |
Cc: | pgsql-general(at)postgreSQL(dot)org |
Subject: | Re: [GENERAL] Re: can't seem to use index |
Date: | 2000-01-11 11:58:21 |
Message-ID: | Pine.BSF.4.10.10001111148260.58707-100000@server.b0x.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
> > 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
From | Date | Subject | |
---|---|---|---|
Next Message | Patrick Welche | 2000-01-11 12:27:12 | Re: [GENERAL] Re: can't seem to use index |
Previous Message | admin | 2000-01-11 11:38:02 | Re: [GENERAL] Re: can't seem to use index |