Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ihoef-0000UZ-26 for pgsql-admin@arkaria.postgresql.org; Thu, 19 Dec 2019 05:47:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ihoed-0000S7-RS for pgsql-admin@arkaria.postgresql.org; Thu, 19 Dec 2019 05:47:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ihoed-0000PF-HP for pgsql-admin@lists.postgresql.org; Thu, 19 Dec 2019 05:47:19 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ihoea-0000Z6-5E for pgsql-admin@postgresql.org; Thu, 19 Dec 2019 05:47:19 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id xBJ5l9JY018013; Thu, 19 Dec 2019 00:47:10 -0500 From: Tom Lane To: Wells Oliver cc: Craig James , pgsql-admin Subject: Re: Query planning around one key of a multi-column index In-reply-to: References: Comments: In-reply-to Wells Oliver message dated "Wed, 18 Dec 2019 20:18:46 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <18011.1576734429.1@sss.pgh.pa.us> Date: Thu, 19 Dec 2019 00:47:09 -0500 Message-ID: <18012.1576734429@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Wells Oliver writes: > Is it really always true that querying off any column that's not the first > column of a multi-column index will NOT use that index? Nope. The planner will consider that, though in most cases it's likely to estimate that there's no benefit to using the index in such cases. Try reading the *actual* docs, not some third-party site: https://www.postgresql.org/docs/current/indexes-multicolumn.html regards, tom lane