Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 66DEC8B63D9 for ; Wed, 20 Jun 2012 12:32:35 -0300 (ADT) Received: from smtp2.peak6.com ([38.98.137.9]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1ShMtW-0004zP-4q for pgsql-performance@postgresql.org; Wed, 20 Jun 2012 15:32:34 +0000 X-AuditID: 0a02cb1e-b7fa76d000000a63-3a-4fe1ed028f1d Message-ID: <4FE1ED03.3090709@optionshouse.com> Date: Wed, 20 Jun 2012 10:32:19 -0500 From: Shaun Thomas Reply-To: Organization: Peak6 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 MIME-Version: 1.0 To: Craig Ringer CC: Eyal Wilde , Subject: Re: index-only scan is missing the INCLUDE feature References: <4FE1D9F9.1020805@ringerc.id.au> In-Reply-To: <4FE1D9F9.1020805@ringerc.id.au> Content-Type: text/plain; charset="UTF-8"; format=flowed content-transfer-encoding: 7bit X-Originating-IP: [10.10.201.64] X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrBIsWRmVeSWpSXmKPExsXClcIrpsv09qG/wfO31hZHjhdbXJ95jtni 0oGnTA7MHu1vulk8Luybxu4xa/pExgDmqAZGm8S8vPySxJJUhZTU4mRbJf+Cksz8vGKP/NLi VAWXzOLknMTM3NQiJYXMFFslcyWFgpzE5NTc1LwSW6XEgoLUvBQlOy4FDGADVJaZp5Cal5yf kpmXbqvkGeyva2FhaqlrqGQXjwwSOlkyNjb9ZCrYx17x+8p/lgbG/6xdjJwcEgImEqdONLFA 2GISF+6tZwOxeQX0Jf68XghWwyKgKvHh2iUwm01AV2JS/wqwGiEBFYm+szeYQGx+AWGJfR+a mEFsUYEQiXNPvkPNEZQ4OfMJ2HwRAQ2JXSvugNUzC3hJ/GyGqBEWcJXYPaUXamahxNw5G8B2 cQLtOvpzJQtEvYXE4jcH2SFseYntb+cwQ9SrSqxonsgGcb+CxP8r75gmMArNQrJ6FpL2WUja FzAyr2IULy5LTM7INCsozi0pMNQrSE3MNtPLSy3ZxAiKZabTcjsYV1xQPMQowMGoxMO7weah vxBrYllxZe4hRgkOZiUR3hcbgEK8KYmVValF+fFFpTmpxYcYTYFhNpFZSjQ5H5hm8kriDY0N LU0tTcwszY2NDZTEeb+vPeMvJJAOTA7ZqakFqUUwfUwcnFINjP31E7Q2FHf09U9+vpyN602X 8O5L846Lx1zb0rM5Ws1p96tkIW95l/enj7bXbJHYr3P3mOOGD+ofAxilGspO2HSnWX02uVVw sPOQyxqb2WlMyhOfPuQ99j3WmtF+b0vdF7/YFdree+49ii8R/KtgoTjj04tbi1J7thhLem/p rOebpTlf9vzUN0osxRmJhlrMRcWJAIK01N37AgAA X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201206/112 X-Sequence-Number: 47138 On 06/20/2012 09:11 AM, Craig Ringer wrote: > For those of us who don't know MS-SQL, can you give a quick > explanation of what the INCLUDE keyword in an index definition is > expected to do, or some documentation references? He's talking about what MS SQL Server commonly calls a "covering index." In these cases, you can specify columns to be included in the index, but not actually part of the calculated hash. This prevents a trip to the table data, so selects can be serviced entirely by an index scan. PostgreSQL is about half way there by allowing index-only scans, though I've no idea if they intend on adding further functionality like this. Effectively you can trade index bloat for query speed. But considering the differences between the engines, it might not be necessary. I couldn't say. -- Shaun Thomas OptionsHouse | 141 W. Jackson Blvd. | Suite 500 | Chicago IL, 60604 312-444-8534 sthomas@optionshouse.com ______________________________________________ See http://www.peak6.com/email_disclaimer/ for terms and conditions related to this email