Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 6DE35632A99 for ; Fri, 18 Jun 2010 06:42:37 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 37248-02 for ; Fri, 18 Jun 2010 09:42:25 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from 63.mail-out.ovh.net (63.mail-out.ovh.net [91.121.185.56]) by mail.postgresql.org (Postfix) with SMTP id A6263632A3D for ; Fri, 18 Jun 2010 06:42:26 -0300 (ADT) Received: (qmail 23491 invoked by uid 503); 18 Jun 2010 09:54:43 -0000 Received: from b6.ovh.net (HELO mail603.ha.ovh.net) (213.186.33.56) by 63.mail-out.ovh.net with SMTP; 18 Jun 2010 09:54:43 -0000 Received: from b0.ovh.net (HELO queueout) (213.186.33.50) by b0.ovh.net with SMTP; 18 Jun 2010 11:42:21 +0200 Received: from par69-8-88-161-102-87.fbx.proxad.net (HELO apollo13) (lists%peufeu.com@88.161.102.87) by ns0.ovh.net with SMTP; 18 Jun 2010 11:42:20 +0200 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Matthew Wakeling" Cc: "Dimitri Fontaine" , "Josh Berkus" , "postgres performance list" Subject: Re: PostgreSQL as a local in-memory cache References: <18287446-8677-46d6-a581-c4777f60ebda@40g2000pry.googlegroups.com> <4C1A5B81.8050908@agliodbs.com> Date: Fri, 18 Jun 2010 11:40:43 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Pierre C" Message-ID: In-Reply-To: User-Agent: Opera Mail/10.10 (Linux) X-Ovh-Tracer-Id: 4574531321585796805 X-Ovh-Remote: 88.161.102.87 (par69-8-88-161-102-87.fbx.proxad.net) X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-Spam-Check: DONE|U 0.5/N X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.8 tagged_above=-10 required=5 tests=BAYES_50=0.8 X-Spam-Level: X-Archive-Number: 201006/331 X-Sequence-Number: 39187 > I'd like to point out the costs involved in having a whole separate > "version" It must be a setting, not a version. For instance suppose you have a session table for your website and a users table. - Having ACID on the users table is of course a must ; - for the sessions table you can drop the "D" Server crash would force all users to re-login on your website but if your server crashes enough that your users complain about that, you have another problem anyway. Having the sessions table not WAL-logged (ie faster) would not prevent you from having sessions.user_id REFERENCES users( user_id ) ... so mixing safe and unsafe tables would be much more powerful than just having unsafe tables. And I really like the idea of non-WAL-logged indexes, too, since they can be rebuilt as needed, the DBA could decide between faster index updates but rebuild on crash, or normal updates and fast recovery. Also materialized views etc, you can rebuild them on crash and the added update speed would be good. > Moreover, we already have a mechanism for taking a table that has had > non-logged changes, and turning it into a fully logged table - we do > that to the above mentioned tables when the transaction commits. I would > strongly recommend providing an option to ALTER TABLE MAKE SAFE, which > may involve some more acrobatics if the table is currently in use by > multiple transactions, but would be valuable. I believe the old discussions called this ALTER TABLE SET PERSISTENCE. > This would allow users to create "temporary tables" that can be shared > by several connections. It would also allow bulk loading in parallel of > a single large table. This would need to WAL-log the entire table to send it to the slaves if replication is enabled, but it's a lot faster than replicating each record.