Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 2BF151337B82 for ; Sun, 6 Feb 2011 10:14:53 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 55922-05 for ; Sun, 6 Feb 2011 14:14:46 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from lnx500.hrz.tu-darmstadt.de (lnx500.hrz.tu-darmstadt.de [130.83.156.225]) by mail.postgresql.org (Postfix) with ESMTP id 5F4D11337B54 for ; Sun, 6 Feb 2011 10:14:44 -0400 (AST) Received: from fire02.rbg.informatik.tu-darmstadt.de (fire02.rbg.informatik.tu-darmstadt.de [130.83.160.8]) by lnx500.hrz.tu-darmstadt.de (8.14.4/8.14.4/HRZ/PMX) with ESMTP id p16EEhv1027617; Sun, 6 Feb 2011 15:14:43 +0100 (envelope-from weissig@rbg.informatik.tu-darmstadt.de) Received: from mail.rbg.informatik.tu-darmstadt.de (localhost [127.0.0.1]) by fire02.rbg.informatik.tu-darmstadt.de (8.13.8+Sun/8.13.8) with ESMTP id p16EEhqr005061; Sun, 6 Feb 2011 15:14:43 +0100 (MET) Received: from [192.168.178.26] (manz-590f1171.pool.mediaWays.net [89.15.17.113]) (authenticated bits=0) by mail.rbg.informatik.tu-darmstadt.de (8.14.3/8.14.3) with ESMTP id p16EEgsV005053 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 6 Feb 2011 15:14:42 +0100 (MET) Message-ID: <4D4EACCD.9040002@rbg.informatik.tu-darmstadt.de> Date: Sun, 06 Feb 2011 15:14:37 +0100 From: =?ISO-8859-15?Q?Yves_Wei=DFig?= Reply-To: weissig@rbg.informatik.tu-darmstadt.de User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0 MIME-Version: 1.0 To: Greg Smith CC: pgsql-general@postgresql.org Subject: Re: effective_io_concurrency References: <4D49C9BA.8020801@rbg.informatik.tu-darmstadt.de> <4D4AD490.7020709@2ndquadrant.com> In-Reply-To: <4D4AD490.7020709@2ndquadrant.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 8bit X-PMX-TU: seen v1.1 by 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2011.2.6.140017 X-PMX-RELAY: mailout X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.962 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FRT_SOMA=2.871, FRT_SOMA2=0.001, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201102/219 X-Sequence-Number: 172485 Thanks for the detailed answer and explanation. I am curious if there is another way to force this behaviour. As a part of my masters thesis I am trying to develop an index which heavily relies on requesting blocks in parallel. Without knowing the code, do I have to dive into it and change it manually or can I accomplish this any other way? Am 03.02.2011 17:15, schrieb Greg Smith: > Yves Weißig wrote: >> I was wondering if there is more information about this switch in the >> configuration. Does it really work? Where in the source code can I >> follow how it works? "sgmgr.c" seems to be an entry point, but where >> exactly is it used? >> > > Currently the code only kicks in when you're doing a Bitmap Heap Scan, > which is really helpful for them, but of no help for any other type of > query. This style of heap scan already knows in advance exactly what > blocks it needs from the database, and normally it just asks for them > one at a time. That can turn into a fair amount of random I/O, and it's > done serially: the next block isn't requested until the last one > arrives. What effective_io_concurrency does is advise the operating > system of the next few blocks the database is going to ask for, before > the actual read requests, in hopes that it might grab them if it happens > to be nearby that area of the disk.e > > I've only seen this feature work at all on Linux. It might work on BSD > and Mac OS X systems, it certainly doesn't do anything on Solaris and > Windows. > > The basic idea is that you start with setting the value to the number of > working drives in the disk array the database is on and see if I/O > performance goes up and/or query speed drops afterwards. If it does you > might try further increases beyond that even. As for why there isn't a > better tuning guide than just those simple guidelines, it's not that > easy to show a situation where the type of bitmap scan this parameter > impacts is used on a generated data set, even though it's not that > uncommon in real-world data. It's hard both to make generic suggestions > here and to even demonstrate the feature at work. > > Moving up the source code chain from smgr, > src/backend/storage/buffer/bufmgr.c has PrefetchBuffer, and the one > place the executor calls that is BitmapHeapNext inside > src/backend/executor/nodeBitmapHeapscan.c >