Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rqLpR-00Btpk-GX for pgsql-hackers@arkaria.postgresql.org; Fri, 29 Mar 2024 23:40:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rqLpQ-005ZeR-GN for pgsql-hackers@arkaria.postgresql.org; Fri, 29 Mar 2024 23:40:08 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rqLpQ-005ZeJ-6N for pgsql-hackers@lists.postgresql.org; Fri, 29 Mar 2024 23:40:08 +0000 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rqLpM-007MnV-3J for pgsql-hackers@postgresql.org; Fri, 29 Mar 2024 23:40:06 +0000 Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-a4734ae95b3so316859366b.0 for ; Fri, 29 Mar 2024 16:40:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1711755603; x=1712360403; darn=postgresql.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=N4Y6oKgqHb7QN7ifXu+LElf03G6DhyNYiECpSTuNgz8=; b=mMK1p9RyZw7Sn3FsWFrUV+NZ5K3SHtLmTz1hA15oOnva92WvLvfkG2Vgl9zm5PAwIL PFBVGF2J/oKaAb+yQKlpuJ54WZo43CdSkbMKoSpmu0u7wUYR9LKVA8u5U5xX4hVf4weY tjxMOJUsTQa87981ycJ6ksq/1R2uxRDRQhQPQdkEqu5QmXwcg+JXy/HowgiLj7Fua7vd +jkatXeYbiiuBeQhyzm7DCWsFZRWGRUtNHWjzNTt/yY1ute9ApiR7ZsTh9EQds1k+K2M XqfNys+HZ1sFPyGlWy8f6glMaMmxVI+OgFpZv6lYGfxu0ZrE4OalrZWHFRkosxp18XRW 1B+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711755603; x=1712360403; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=N4Y6oKgqHb7QN7ifXu+LElf03G6DhyNYiECpSTuNgz8=; b=HRUfzPzfgmLeby8Qqhsgi3lZGwjxIGmv3qcixAtNDNXYr0zARnPy3GTeUBbY6ehWIE Kvbmr5ZNXM04lDqE9y3dEVgbD5vOoc99BIybDSNcV7royS9cdcVoCvR7EZDxdjSYARgZ c3b6QXUslb6yc8M45Hrx7RxfJb8MTew9DT6/to+1h4n2ju+p/BczUHDyBYW0k83fi5yg abCABRxrw/NCITCy4UI9oO6H+MMU9v9ih2q5RzwTlr38/K0VA1U/3R0+/HDral1zUVYK 9XgXmBCqUgv58ebSxklotmDZDC3UWyriXxu/J2V4USNIWideyFGvvCRQiY8nPrdi1sy+ OtbA== X-Forwarded-Encrypted: i=1; AJvYcCXsR+4yqRYhq/b+opzstL4iQpgp45mxr5mZS2o5ABHmzqVc8/ocPVLnKB/Nh4/wmF6+ct0JPFziV3iFS8s+cJ+O+Y9Xa4OjyCuC6PJ7 X-Gm-Message-State: AOJu0YwuLwOLR59JzGpp5I+H2RHDkZ15oYMwt4ccl0AeRMBwUCj3qO7e RXi/r/YtRg5xcUO4IoDDaP6leHMkAX7gQMNtHzUV7mQO3599GBfJWeNq7QqdZA== X-Google-Smtp-Source: AGHT+IHyXpYRUHzKonEswSGJKMkLIn2fKVEqU+IpbgkNZngQB4uQVkhNrLba/9zqpYII2+78w9924Q== X-Received: by 2002:a17:906:5290:b0:a46:e0a8:d5d3 with SMTP id c16-20020a170906529000b00a46e0a8d5d3mr2250925ejm.22.1711755602001; Fri, 29 Mar 2024 16:40:02 -0700 (PDT) Received: from [10.137.0.18] (ip-86-49-229-30.bb.vodafone.cz. [86.49.229.30]) by smtp.gmail.com with ESMTPSA id w20-20020a170906d21400b00a4750705a07sm2450564ejz.190.2024.03.29.16.40.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 29 Mar 2024 16:40:01 -0700 (PDT) Message-ID: <18200c04-84a1-46ad-b3a7-c1617f6f39ae@enterprisedb.com> Date: Sat, 30 Mar 2024 00:40:01 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: BitmapHeapScan streaming read user and prelim refactoring Content-Language: en-US To: Thomas Munro Cc: Melanie Plageman , Heikki Linnakangas , Andres Freund , Pg Hackers , Nazir Bilal Yavuz References: <5a172d1e-d69c-409a-b1fa-6521214c81c2@iki.fi> <20240323002607.abegehmmjyxrnmm2@liskov> <20240324173833.rdtw42aur2q5hhb2@liskov> <58fa8dd3-a49b-4774-a9c4-7422ba8bc698@enterprisedb.com> <358c737e-772c-40dd-9ecf-35b0c05828cd@enterprisedb.com> <20240325160709.qjo6txzu6zjxzkqy@liskov> <20240327193750.3mlcmzqondpj27xe@liskov> <7e98781c-34e0-4c02-8e5b-0500aa074271@enterprisedb.com> <8330278b-9615-4030-8626-51ce714a7f54@enterprisedb.com> <3ac67b68-47ff-4edb-bb9e-d86504acd573@enterprisedb.com> From: Tomas Vondra In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 3/29/24 22:39, Thomas Munro wrote: > ... > >> I don't recall seeing a system with disabled readahead, but I'm >> sure there are cases where it may not really work - it clearly can't >> work with direct I/O, ... > > Right, for direct I/O everything is slow right now including seq scan. > We need to start asynchronous reads in the background (imagine > literally just a bunch of background "I/O workers" running preadv() on > your behalf to get your future buffers ready for you, or equivalently > Linux io_uring). That's the real goal of this project: restructuring > so we have the information we need to do that, ie teach every part of > PostgreSQL to predict the future in a standard and centralised way. > Should work out better than RA heuristics, because we're not just > driving in a straight line, we can turn corners too. > >> ... but I've also not been very successful with >> prefetching on ZFS. > > posix_favise() did not do anything in OpenZFS before 2.2, maybe you > have an older version? > Sorry, I meant the prefetch (readahead) built into ZFS. I may be wrong but I don't think the regular RA (in linux kernel) works for ZFS, right? I was wondering if we could use this (posix_fadvise) to improve that, essentially by issuing fadvise even for sequential patterns. But now that I think about that, if posix_fadvise works since 2.2, maybe RA works too now?) regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company