Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id B34B21337999 for ; Mon, 25 Oct 2010 15:46:33 -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 32990-03 for ; Mon, 25 Oct 2010 18:46:26 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from nm25-vm0.bullet.mail.sp2.yahoo.com (nm25-vm0.bullet.mail.sp2.yahoo.com [98.139.91.228]) by mail.postgresql.org (Postfix) with SMTP id 08A61133616B for ; Mon, 25 Oct 2010 15:46:25 -0300 (ADT) Received: from [98.139.91.62] by nm25.bullet.mail.sp2.yahoo.com with NNFMP; 25 Oct 2010 18:46:24 -0000 Received: from [98.139.91.29] by tm2.bullet.mail.sp2.yahoo.com with NNFMP; 25 Oct 2010 18:46:24 -0000 Received: from [127.0.0.1] by omp1029.mail.sp2.yahoo.com with NNFMP; 25 Oct 2010 18:46:24 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 688286.53721.bm@omp1029.mail.sp2.yahoo.com Received: (qmail 56987 invoked by uid 60001); 25 Oct 2010 18:46:24 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1288032384; bh=vblYftspXLlWcT9Fp9piuliCu0rXyiLZZaBCfGcXXTA=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=OhYwBYwcB+wFVpZ1RhMdkQt6G+dqAmTW/TpXYslOb874TLM4X3YLtU3GLHw3MgUd6scvXlFkHVrJO/76SrUuhsj0NQjzz2w0/UD32aU/ESPL//uy4+hNiXcFh8ccsS+X8aHLOfo1fRSevHEm4Y3bYDELMHunHHSzYC1VT2xW2P0= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=TAit+q2xOAB/vOZBRZwDhzBBVq/ptiDJ0sJKC+/pPS7MKB79jdLfhx3yObmcl4tXYYN6kly6HKE+Mgd2iwzJRNz4BbWm7i8doY9wzF/NRn1dr+oGTF20FUUZ6X14EszCWQNHrwJ5uNnG/zFbyuKDifPLrH8p18iSPp5FDoYiN98=; Message-ID: <203952.56702.qm@web111712.mail.gq1.yahoo.com> X-YMail-OSG: C2N6qZkVM1njQQ0WDuekESNyvHUT51KBou4f.32HIOY8Iw_ kEfuu87QkzTDRqODe.sVUFpR51LFxvoy2X1PTvSuyiwD_mFqOaSURVNMX03o dQBXepsEpmp3Dph0a6f1o04QdwJcO3byjgRoqo3e0E76q_8OINQtiD1TlVmW yjBgKVcXLX4Tl2rOwpubo9FRo4BeROtb24kFpliPfdgFTzE7OjpGb5F0..Ue rOfvhPgqwlnRNYQiTQPQXeWOQwJOZkxGqQVWHyCPszSehBZRXbsSorQc663O WLHXhdUELBYgylpnAGyQeIxSziLYLsxLQeIKj Received: from [163.181.251.103] by web111712.mail.gq1.yahoo.com via HTTP; Mon, 25 Oct 2010 11:46:23 PDT X-Mailer: YahooMailRC/504.5 YahooMailWebService/0.8.107.284920 Date: Mon, 25 Oct 2010 11:46:23 -0700 (PDT) From: Steve Wong Subject: MVCC and Implications for (Near) Real-Time Application To: pgsql-performance@postgresql.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-199831977-1288032383=:56702" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.909 tagged_above=-10 required=5 tests=BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201010/576 X-Sequence-Number: 40994 --0-199831977-1288032383=:56702 Content-Type: text/plain; charset=us-ascii Hi experts, I have a (near) real-time application in which inserts into the database needs to be visible to queries from other threads with minimal delay. The inserts are triggered by real-time events and are therefore asynchronous (i.e. many performance tips I read related to batch inserts or copy do not apply here, since these events cannot be predicted or batched), and the inserted data need to be available within a couple of seconds to other threads (for example, an inserted row that only appears to other query threads 5 seconds or more after the insert is not acceptable). The delay should be under 2 seconds maximum, sub-1 second would be great. My questions are: (1) Does the MVCC architecture introduce significant delays between insert by a thread and visibility by other threads (I am unclear about how multiple versions are "collapsed" or reconciled, as well as how different query threads are seeing which version)? (2) Are there any available benchmarks that can measure this delay? (3) What are relevant config parameters that will reduce this delay? Thanks for your patience with my ignorance of MVCC (still learning more about it), Steve --0-199831977-1288032383=:56702 Content-Type: text/html; charset=us-ascii
Hi experts,

I have a (near) real-time application in which inserts into the database needs to be visible to queries from other threads with minimal delay. The inserts are triggered by real-time events and are therefore asynchronous (i.e. many performance tips I read related to batch inserts or copy do not apply here, since these events cannot be predicted or batched), and the inserted data need to be available within a couple of seconds to other threads (for example, an inserted row that only appears to other query threads 5 seconds or more after the insert is not acceptable). The delay should be under 2 seconds maximum, sub-1 second would be great.

My questions are: (1) Does the MVCC architecture introduce significant delays between insert by a thread and visibility by other threads (I am unclear about how multiple versions are "collapsed" or reconciled, as well as how different query threads are seeing which version)? (2) Are there any available benchmarks that can measure this delay? (3) What are relevant config parameters that will reduce this delay?

Thanks for your patience with my ignorance of MVCC (still learning more about it),
Steve

--0-199831977-1288032383=:56702--