Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1glrY1-0000pi-23 for pgsql-general@arkaria.postgresql.org; Tue, 22 Jan 2019 08:36:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1glrXy-0006iM-9Y for pgsql-general@arkaria.postgresql.org; Tue, 22 Jan 2019 08:36:38 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1glrXx-0006iE-VK for pgsql-general@lists.postgresql.org; Tue, 22 Jan 2019 08:36:38 +0000 Received: from mail-oi1-x22b.google.com ([2607:f8b0:4864:20::22b]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1glrXs-0006FZ-Nd for pgsql-general@lists.postgresql.org; Tue, 22 Jan 2019 08:36:37 +0000 Received: by mail-oi1-x22b.google.com with SMTP id u18so16708706oie.10 for ; Tue, 22 Jan 2019 00:36:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=99m+Ll+vje9244OixIk8t2FBj/J+mWslKO/5/AjXdFs=; b=VZDo6JuXgzagO7lo5QaXI+/z01SM7HVGQBs7zwHIBS4oId9wq8H/IcyOfLq+OCd403 5USDyCnH8xWEspKNfYk8DUNTgLJEkaQMX3LO8LIi6chAhmIZf5rK8CF6F+CC4M60joJI wnRrVDlBIvKlbDjo8xWfPV4C8PK6RlXnX5/yg8j8aFKhwHqPvRQxJMGhZbVq8/gvIQSN Z21vlckJOvl5xb4dunKKmp6iDjBr4rCIIBJJWPYuzqyGlbAY9+cJmi2sTd1gTuMOKmA7 1kTP0LXhhzbKG2mj5q+GMQFI1E3X07Gy+TuhtL79VXnxvgwSPgACbJhjYcbPZ4FyxsD5 tL4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=99m+Ll+vje9244OixIk8t2FBj/J+mWslKO/5/AjXdFs=; b=JN19DNRjyGt+04pruELZiYQ4vF6qeCPwhwBn50UIRW1ds3f/wxWABQCv37ik0m7fVC wC/br5TFfrpzS+zRgpD5n4SvRNS4X0ILe+rkAFHyRBAhB42uhIvc4ORwjM+6H58AN4c5 3JwkktNXw1AIL3aeaaYcW+SgnCmAMzLIygZgQAZP7voBI9YNb4FmvBGyqvSJ92nF1sLX E9uTvlQ6O0lSO8kWT07cUKebEr2pe9z9kplP0tesAxSBRnaMPD+PyhHFc/dM+1Jb9KPM M8QFX2ayx/4Kr7yrq7DR2mHt9sKglQGAeJYqJRPglspGwLNlj2aO3Mwoq88L10jE4esM CDiQ== X-Gm-Message-State: AJcUukee5rLsnuDXGeXU8QQSoHPzE2UI8J2aj06v1QO32p2qQC8mDHbP mkxsb5c1pUh0td2Gz0sBqv8jM7Cf X-Google-Smtp-Source: ALg8bN5fv94OqQs6dnpT5OKHMOq/gWkwXk9G+73jVG4fTqPD0ZJMlwBYSflFnpiiiqLZQ7jGGV919Q== X-Received: by 2002:aca:af53:: with SMTP id y80mr6346146oie.170.1548146190170; Tue, 22 Jan 2019 00:36:30 -0800 (PST) Received: from [192.168.1.10] (ip70-171-116-89.no.no.cox.net. [70.171.116.89]) by smtp.googlemail.com with ESMTPSA id h7sm6632093otb.45.2019.01.22.00.36.28 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Jan 2019 00:36:29 -0800 (PST) Subject: Re: Tuning threshold for BAS_BULKREAD (large tables) To: pgsql-general@lists.postgresql.org References: From: Ron Message-ID: <4154037a-50e1-7fbf-9521-3589ec975f42@gmail.com> Date: Tue, 22 Jan 2019 02:36:28 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------9F6B4BFDF59F008297834FE6" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------9F6B4BFDF59F008297834FE6 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 1/22/19 1:35 AM, Jamison, Kirk wrote: > > Hi, > > I have a source code-related question on BufferAccessStrategyType > BAS_BULKREAD. > > Currently, this access method is set internally to cache tables larger > than 1/4 of shared_buffers. > > src/backend/access/heap/heapam.c:initscan() > >      if (!RelationUsesLocalBuffers(scan->rs_rd) && > > scan->rs_nblocks > NBuffers / 4) > >         ... > >          /* During a rescan, keep the previous strategy object. */ > >          if (scan->rs_strategy == NULL) > >    scan->rs_strategy = GetAccessStrategy(BAS_BULKREAD); > > Users can tune their shared_buffers size, but not able to tune this component. > > I'm just wondering how it affects the current workload when the table size > is larger than the database. > How can a subset of the database be larger than the database? -- Angular momentum makes the world go 'round. --------------9F6B4BFDF59F008297834FE6 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit On 1/22/19 1:35 AM, Jamison, Kirk wrote:

Hi,

 

I have a source code-related question on BufferAccessStrategyType BAS_BULKREAD.

Currently, this access method is set internally to cache tables larger than 1/4 of shared_buffers.

src/backend/access/heap/heapam.c:initscan()

     if (!RelationUsesLocalBuffers(scan->rs_rd) &&

         scan->rs_nblocks > NBuffers / 4)

        ...

         /* During a rescan, keep the previous strategy object. */

         if (scan->rs_strategy == NULL)

             scan->rs_strategy = GetAccessStrategy(BAS_BULKREAD);

 

Users can tune their shared_buffers size, but not able to tune this component.

I'm just wondering how it affects the current workload when the table size is larger than the database.


How can a subset of the database be larger than the database?


--
Angular momentum makes the world go 'round.
--------------9F6B4BFDF59F008297834FE6--