Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W8gj5-0004bt-8y for pgsql-performance@arkaria.postgresql.org; Thu, 30 Jan 2014 01:47:31 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1W8gj4-0006KX-KH for pgsql-performance@arkaria.postgresql.org; Thu, 30 Jan 2014 01:47:30 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W8gj3-0006KR-Sa for pgsql-performance@postgresql.org; Thu, 30 Jan 2014 01:47:29 +0000 Received: from sam.nabble.com ([216.139.236.26]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W8giw-0002rE-0D for pgsql-performance@postgresql.org; Thu, 30 Jan 2014 01:47:29 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1W8git-0006yK-2i for pgsql-performance@postgresql.org; Wed, 29 Jan 2014 17:47:19 -0800 Date: Wed, 29 Jan 2014 17:47:19 -0800 (PST) From: jugnooken To: pgsql-performance@postgresql.org Message-ID: <1391046439075-5789624.post@n5.nabble.com> In-Reply-To: <9852.1391037355@sss.pgh.pa.us> References: <1391030357379-5789581.post@n5.nabble.com> <9852.1391037355@sss.pgh.pa.us> Subject: Re: WHERE with ORDER not using the best index MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: 0.0 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org Thank you so much for the prompt reply, Tom. The index is actually fairly new - but to be safe I issued REINDEX TABLE so that they are all clean. Here are the sizes of each index right after REINDEX. db=> select pg_size_pretty(pg_relation_size('index_social_feed_feed_items_on_social_feed_id_and_posted_at')); pg_size_pretty ---------------- 149 MB (1 row) db=> select pg_size_pretty(pg_relation_size('index_social_feed_feed_items_on_social_feed_id')); pg_size_pretty ---------------- 106 MB (1 row) Unfortunately, pg still thinks using index_social_feed_feed_items_on_social_feed_id is faster although they are about the same size :(. Any idea? Regards, Ken -- View this message in context: http://postgresql.1045698.n5.nabble.com/WHERE-with-ORDER-not-using-the-best-index-tp5789581p5789624.html Sent from the PostgreSQL - performance mailing list archive at Nabble.com. -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance