Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TsdYL-0005nE-AX for pgsql-performance@arkaria.postgresql.org; Tue, 08 Jan 2013 18:05:33 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TsdYK-00033a-QZ for pgsql-performance@arkaria.postgresql.org; Tue, 08 Jan 2013 18:05:32 +0000 Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TsdYJ-00033S-Tr for pgsql-performance@postgresql.org; Tue, 08 Jan 2013 18:05:32 +0000 Received: from qmta15.westchester.pa.mail.comcast.net ([2001:558:fe14:44:76:96:59:228]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TsdYG-00024C-75 for pgsql-performance@postgresql.org; Tue, 08 Jan 2013 18:05:31 +0000 Received: from omta10.westchester.pa.mail.comcast.net ([76.96.62.28]) by qmta15.westchester.pa.mail.comcast.net with comcast id lQo51k0060cZkys5FW5Si2; Tue, 08 Jan 2013 18:05:26 +0000 Received: from [192.168.1.176] ([69.142.185.164]) by omta10.westchester.pa.mail.comcast.net with comcast id lW5R1k00l3ZEZL53WW5SvZ; Tue, 08 Jan 2013 18:05:26 +0000 Message-ID: <50EC5FC7.7000902@comcast.net> Date: Tue, 08 Jan 2013 13:04:55 -0500 From: AJ Weber User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 MIME-Version: 1.0 To: Jeff Janes CC: "pgsql-performance@postgresql.org" Subject: Re: Partition table in 9.0.x? References: <50E65B85.9000001@synedra.com> <50E74A33.5000204@comcast.net> <50E997C5.2000301@comcast.net> <50EC4D3D.9060209@comcast.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1357668326; bh=CXxhIkqgP2CnMY3NPZAkdoVdqX5es8/cm6yBvLUoEw8=; h=Received:Received:Message-ID:Date:From:MIME-Version:To:Subject: Content-Type; b=nGYkbn0SVnTqXkvadGIKUykIAu4cN/bcnhVzXvMexQl4CB1HrxHYYKO/QjO5Arb61 M9dxcx6pE5khfSMDkEBFEti4NsmEy9nnDYsYdsO3gR10RIrtm3UwWglaHJdcrHv1hj SPNIaDeErthRYvNLUZ1x+7RNqmNs1FNCGo7QPUyO1Sou0ranuDQAgs2YnrsMdi6lrG N5oee8u3URQU0vqK82LwrdcKV2PYAf1uRCeaC3z02E92uzpzwV042ygpJ9bOiCsJs/ S5+IZz8x9ZGGdm2lCFERLDEwWrdsYn65KqhYwIajj+8bjrFeRuzT5lCAe/YlVBNa5S 6XBSxeYIo0YNQ== X-Pg-Spam-Score: -2.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 > It does if you use it without an argument, to display all the tables > in the search path: > > jjanes=# \d+ > List of relations > Schema | Name | Type | Owner | Size | Description > --------+------------------+-------+--------+---------+------------- > public | pgbench_accounts | table | jjanes | 128 MB | > public | pgbench_branches | table | jjanes | 40 kB | > public | pgbench_history | table | jjanes | 0 bytes | > public | pgbench_tellers | table | jjanes | 40 kB | > (4 rows) > > It rather annoys me that you actually get less information (no size, > no owner) when you use \d+ on a named table. I don't know if there is > a reason for that feature, or if it was just an oversight. That is rather peculiar. Sorry for that. Table in question is 9284MB (Parent table is 621MB) > > The current constraint exclusion code is quite simple-minded and > doesn't know how to make use of check constraints that use the mod > function, so the indexes of all partitions would have to be searched > for each order_num-driven query, even though we know the data could > only exist in one of them. The constraint exclusion codes does > understand check constraints that involve ranges. Hmm. That's a bit of a limitation I didn't know about. I assume it doesn't understand the percent (mod operator) just the same as not understanding the MOD() function? Either way, I guess this strategy does not pan-out. > There could still be some benefit as the table data would be > concentrated, even if the index data is not. I'm reaching way, way back in my head, but I think _some_ RDBMS I worked with previously had a way to "cluster" the rows around a single one of the indexes on the table, thus putting the index and the row-data "together" and reducing the number of IO's to retrieve the row if that index was used. Am I understanding that PG's "cluster" is strictly to group like rows together logically -- table data only, not to coordinate the table row with the index upon which you clustered them? > >> and all rows for the same order would stay >> within the same partition-table. > But usually a given order_num would only be of interest for a fraction > of a second before moving on to some other order_num of interest, so > by the time the relevant partition become fully cached, it would no > longer be hot. Or, if the partitions were small enough, you could > assume that all rows would be dragged into memory when the first one > was requested because they lay so close to each other. But it is not > feasible to have a large enough number of partitions to make that > happen. But if the table is clustered, this is exactly what you would > get--the trouble would be keeping it clustered. If most of the > line-items are inserted at the same time as each other, they probably > should be fairly well clustered to start with. Does decreasing the fill to like 90 help keep it clustered in-between times that I could shutdown the app and perform a (re-) cluster on the overall table? Problem is, with a table that size, and the hardware I'm "blessed with", the cluster takes quite a bit of time. :( -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance