Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1a7TcW-0006WJ-Fv for pgsql-performance@arkaria.postgresql.org; Fri, 11 Dec 2015 19:44:48 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1a7TcW-0006GE-1I for pgsql-performance@arkaria.postgresql.org; Fri, 11 Dec 2015 19:44:48 +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_SHA384:256) (Exim 4.84) (envelope-from ) id 1a7TcU-0006Dw-Sn for pgsql-performance@postgresql.org; Fri, 11 Dec 2015 19:44:46 +0000 Received: from mailout01.ims-firmen.de ([213.174.32.96]) by magus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1a7TcS-0005pl-0r for pgsql-performance@postgresql.org; Fri, 11 Dec 2015 19:44:46 +0000 Received: from mailin01.ims-firmen.de ([192.168.1.141]) by mailout01.ims-firmen.de with esmtp (envelope-from ) id 1a7TcQ-0004D1-gh for pgsql-performance@postgresql.org; Fri, 11 Dec 2015 20:44:42 +0100 Received: from [79.204.171.189] (helo=a-kretschmer.de) by mailin01.ims-firmen.de with esmtpsa (TLSv1:AES256-SHA:256) (envelope-from ) id 1a7TcP-0000v8-2t for pgsql-performance@postgresql.org; Fri, 11 Dec 2015 20:44:42 +0100 Received: from kretschmer by a-kretschmer.de with local (Exim 4.69) (envelope-from ) id 1a7TcO-0003t9-UZ for pgsql-performance@postgresql.org; Fri, 11 Dec 2015 20:44:40 +0100 Date: Fri, 11 Dec 2015 20:44:40 +0100 From: Andreas Kretschmer To: pgsql-performance@postgresql.org Subject: Re: partitioned table set and indexes Message-ID: <20151211194440.GA14772@tux> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-OS: Debian/GNU Linux - weil ich es mir Wert bin! X-GPG-Fingerprint: EE16 3C01 7B9C 10F7 2C8B 3B86 4DB3 D9EE 7F45 84DA X-Message-Flag: "Windows" is not the answer. "Windows" is the question and the answer is "no"! X-Lugdd: Gerd Kube X-Info: My name is root. Just root. And I am licensed to kill -9 User-Agent: Mutt/1.5.18 (2008-05-17) X-Pg-Spam-Score: -2.6 (--) 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 Rick Otten wrote: > I'm using PostgreSQL 9.5 Beta 2. > > I am working with a partitioned table set. > > The first thing I noticed, when creating indexes on the 20 or so partitions, > was that if I create them too fast they don't all succeed.  I have to do a few > at a time, let them breathe for a few seconds, and then do a few more.   I had > been simply generating all of the create index commands in a text editor, and > then cutting and pasting the lot of them into psql all at once or running them > by using psql '-f'.  Most would get created, but not all.  It seems almost > random.  There were no obvious error messages.  When I do a few at a time, it > is never an issue. Sure? Have you checked that? > If I do a simple query with a where clause on a specific column from the parent > table, I can see it index scan each of the children.  This is what I want it to > do, so no complaints there. > > However, if I try to (inner) join another table with that column, the planner > sequence scans each of the children instead of using the indexes.  I saw > someone had posted a similar question to this list back in January, however I > didn't see the answer. Show us the output from explain analyse > FWIW, the column in question is a UUID column and is the primary key for each > of the child tables. PostgreSQL using a cost-modell, so maybe there are not enough rows in the table. That's just a guess, you can see that with explain analyse ... Andreas -- Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect. (Linus Torvalds) "If I was god, I would recompile penguin with --enable-fly." (unknown) Kaufbach, Saxony, Germany, Europe. N 51.05082°, E 13.56889° -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance