Re: [GENERAL] index being ignored for "limit n" queries

2005-08-10 Thread Piotr Sulecki
Ave! Tom Lane wrote: >>trax=# explain select * from pakiety where stid = 234::smallint order by >>received desc limit 1; > > The reason this won't use the (stid, received) index is that the > requested sort order doesn't match that index. Try > > select * from pakiety where stid = 234::smallint

Re: [GENERAL] index being ignored for "limit n" queries

2005-08-09 Thread Tom Lane
Piotr Sulecki <[EMAIL PROTECTED]> writes: > I have two really big tables, the problem is with one of them. The table > looks as follows: > ... > Indexes: > "pakiety_pkey" PRIMARY KEY, btree (pktid) > "pakiety_stid_received_idx" UNIQUE, btree (stid, received) > "pakiety_measured_idx" btr

[GENERAL] index being ignored for "limit n" queries

2005-08-09 Thread Piotr Sulecki
Ave! Yesterday I noticed a problem with my PostgreSQL installation. I have three database clusters, one using version 7.4.6 and the rest using version 8.0.1. The problem manifests itself in all three installations. (The three databases are copies of -- more or less -- the same data; now I'm writin