Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TTXyn-0004Em-7x for pgsql-performance@postgresql.org; Wed, 31 Oct 2012 13:05:09 +0000 Received: from smtp2.peak6.com ([38.98.137.9]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TTXyd-0003o7-Qi for pgsql-performance@postgresql.org; Wed, 31 Oct 2012 13:05:07 +0000 X-AuditID: 0a02cb20-b7f726d000005255-98-509121f8228f Received: from sswchi5pcas2.peak6.net (sswchi5pcas2.peak6.net [10.100.13.24]) by smtp2.peak6.com (Symantec Messaging Gateway) with SMTP id DB.2B.21077.8F121905; Wed, 31 Oct 2012 08:04:56 -0500 (CDT) Received: from [10.10.201.64] (10.10.201.64) by sswchi5pcas2.peak6.net (10.100.13.25) with Microsoft SMTP Server (TLS) id 14.2.247.3; Wed, 31 Oct 2012 08:04:56 -0500 Message-ID: <509121F7.30505@optionshouse.com> Date: Wed, 31 Oct 2012 08:04:55 -0500 From: Shaun Thomas Reply-To: Organization: Peak6 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121011 Thunderbird/16.0.1 MIME-Version: 1.0 To: Vincenzo Melandri CC: Subject: Re: Seq scan on big table, episode 2 References: In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed content-transfer-encoding: 7bit X-Originating-IP: [10.10.201.64] X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupnleLIzCtJLcpLzFFi42LhSuGV0P2hODHA4Mlla4vrM88xW0zt2szk wOSx+dQaJo8L+6axBzBFNTDaJObl5ZcklqQqpKQWJ9sq+ReUZObnFXvklxanKrhkFifnJGbm phYpKWSm2CoZKykU5CQmp+am5pXYKiUWFKTmpSjZcSlgABugssw8hdS85PyUzLx0WyXPYH9d CwtTS11DJbt4ZJDQyZIx8f5ZloKzbBX7t+5hbGBcydrFyMEhIWAi8f94TBcjJ5ApJnHh3nq2 LkYuDiGBE4wSf27NhnJWMkpcnPifHaSKV0BX4t2tdkYQm0VAVeLfjhZmEJsNKD6pfwUbiC0k oCLRd/YGE4jNLyAsse9DE1iNqECYxPKdm5kg5ghKnJz5hAXEFgHq3TJ9JthMZgE1ibkPJ7GC 2MIC5hI919YyQswMkPgw+TvYDZwCgRLb+k6xQNRbSCx+c5AdwpaX2P52DjNEvarEiuaJbBCf KUj8v/KOaQKjyCwkq2chaZ+FpH0BI/MqRvHissTkjEyzguLckgIjvYLUxGwzvbzUkk2MoFhn Oq2wg3Fzj9UhRgEORiUe3onsEwKEWBPLiitzDzFKcDArifDO/gYU4k1JrKxKLcqPLyrNSS0+ xOgDDLOJzFKiyfnANJRXEm9obGpgamlqaGpuamiEQ1hJnPfS7bYAIYF0YPLJTk0tSC2CGcfE wSnVwHio9fXtee2avaqz3x/OXF2z8i/Xx49l6w62u/Pv31u6LOdcdMCBzprXbxQsL3I08y0N /yBYoBHKVmG/YTnHk3K9kIofrbc6f2nr1mo1JPmXmyY+jrnkxh/4+dWCU7F8rTfyHgouDrvO N9PmqLWRgnStKceB4mfllnNmrPF9ZvqbqZM1T9vNT4mlOCPRUIu5qDgRAPvfVK0iAwAA X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201210/402 X-Sequence-Number: 48361 On 10/31/2012 05:55 AM, Vincenzo Melandri wrote: > on People: > CREATE UNIQUE INDEX people_pkey ON people USING btree (key1, key2) > CREATE INDEX people_pkey_hash_loc ON people USING hash (key1); > CREATE INDEX people_pkey_hash_id ON people USING hash (key2); I can't say why it would ignore the first index in this particular JOIN, but you might as well discard both of those hash indexes. Also, people_pkey_hash_loc is basically pointless anyway, as the database can use the first column in a multi-column index as if it were a single column index. I *can* ask you why you're using HASH indexes, though. They're not WAL logged, so they can't be replicated, and they're also not crash safe. -- 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