Received: from web21003.mail.yahoo.com (web21003.mail.yahoo.com [216.136.227.57]) by postgresql.org (8.11.3/8.11.4) with SMTP id fBSBG1m87007 for ; Fri, 28 Dec 2001 06:16:01 -0500 (EST) (envelope-from hal_bg@yahoo.com) Message-ID: <20011228111603.47764.qmail@web21003.mail.yahoo.com> Received: from [212.50.3.253] by web21003.mail.yahoo.com via HTTP; Fri, 28 Dec 2001 03:16:03 PST Date: Fri, 28 Dec 2001 03:16:03 -0800 (PST) From: Heni Lolov Subject: indexes bug or feature To: pgsql-admin@postgresql.org In-Reply-To: <200112281016.fBSAGTm84562@postgresql.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Archive-Number: 200112/156 X-Sequence-Number: 2879 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