pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heni Lolov <hal_bg@yahoo.com>
To: pgsql-admin@postgresql.org
Subject: indexes bug or feature
Date: Fri, 28 Dec 2001 03:01:49 -0800 (PST)
Message-ID: <20011228110149.79581.qmail@web21006.mail.yahoo.com> (raw)
In-Reply-To: <200112281016.fBSAGTm84562@postgresql.org>

Hi

Ihave some problems with the indexes with Pg7.0.3 and
Pg7.2b2. The problem is:

I have folowing table 

create table usno(
        reg_id int2,
        id int2,
        ra int4, 
        de int4,
        mag_r int2,
        mag_b int2
);

I make indexes in this order:
create index usno_drm_r on gsc_act(de,ra,mag_r);
create index usno_drm_b on gsc_act(de,ra,mag_b);

the problem is:
when I search on "de","ra" and "mag_b" or "de", "ra"
and "mag_r" Postgres uses always "usno_drm_r". 
If I create the indexes in reversed order 
"usno_drm_b" is always used.

The same problem apears in 7.2b2 but here there is a
similar problem with partial indexes.

When I create two indexes one full and the second on a
subset(partial) and if the searched values exists in
the two of them the index been first created is used,
regardles the partial index search will be faster.

NB I am not sure if the first index or the second
index been created is searched. I cant chek it right
now. The problem is easyly reproduced.

So is this a bug or feature?

yours,
Heni 

__________________________________________________
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com



view thread (6+ messages)  latest in thread

Message-ID: <20011228110149.79581.qmail@web21006.mail.yahoo.com>
Permalink:  ../20011228110149.79581.qmail@web21006.mail.yahoo.com/
Also on:    postgresql.org/message-id/20011228110149.79581.qmail@web21006.mail.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: hal_bg@yahoo.com
  Subject: Re: indexes bug or feature
  In-Reply-To: <20011228110149.79581.qmail@web21006.mail.yahoo.com>
  References: <200112281016.fBSAGTm84562@postgresql.org> <20011228110149.79581.qmail@web21006.mail.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox