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 1rqA39-00AvGt-42 for pgsql-hackers@arkaria.postgresql.org; Fri, 29 Mar 2024 11:05:31 +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 1rqA37-00GedC-6J for pgsql-hackers@arkaria.postgresql.org; Fri, 29 Mar 2024 11:05:29 +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 1rqA36-00Ged4-Sd for pgsql-hackers@lists.postgresql.org; Fri, 29 Mar 2024 11:05:28 +0000 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rqA2y-007HQu-C7 for pgsql-hackers@postgresql.org; Fri, 29 Mar 2024 11:05:27 +0000 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-4149521d76aso12561655e9.3 for ; Fri, 29 Mar 2024 04:05:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1711710318; x=1712315118; darn=postgresql.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=+G/Qnfiy2LM4M/02CdUPnP006IH+F71NkklrijBZVrc=; b=CEAASv2XaM3YDz2Bfwwtd/IIAOzEoyOygURGqf81/B45Fn0SKKm+U5gAShTNFW6UTB 5bbjKuofodMe20wFgHT3rK6kUn7ZluULPJ5uun5jPYdFkatndBjplRQf8LWx0N1aSZri t3kLf77nY8r2PRCHeE1+WpOBRUXQ+rwBrYXSP6GjdeZDMZTl/S1p0WQie6KAyGsanZp7 Q6CAIGuAjLsd8ktGhgYAcJuTHdElYuFn9syGKnkjcFGUN9PQ3F0Rxvh9eXJuagHLqYYn KI+H/vwC78ykfnt/pnMYz7VD1lLskf9gKKNv/kqNeBfx58VFclM+Z9jEIxz9jSQrUyJw mrEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711710318; x=1712315118; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+G/Qnfiy2LM4M/02CdUPnP006IH+F71NkklrijBZVrc=; b=tBLUkN077r1eApUKDjn5+XaeVlHhAe4M91BXacRJoo+ZVhb1V63c9EhRyLSqfhhaY+ PCKoODIJ8Nc0WT64qfN1INIXm152mIaemsWehCf5SQ6ji6huektFn32CNm93w+Jh8qH8 Exlo+aoJvB2/tBbyxX4qCBK1BQILIcdYb/+xPw8DMMONMFyk6UNYXrP4xeECVHPv9C2z zPJNDg89+FBR4nPx4YfHj2JPK7p3GWQdhBElC2ba7oHxjMO0KTPbUMbQ8ryLhff4arSx i/+vRBeLiP5Xxtc+L6V3oX3it3lJZZ7ldGXKT/xd8rnauoIenFFBMp/pK89+aGj/+MJR r4YA== X-Forwarded-Encrypted: i=1; AJvYcCUx2NhsHWOgKS/xWy9UK+nDNj8unNmbg7t4B3epN3oZuZ32d1eFbhxkEFa3Q6GQZcik5SV0OYT4jHDsMasVztzM5oB7C8kKc0nbKoC6 X-Gm-Message-State: AOJu0YxOnAlIIpWMb28igf7Jfl7TDxk+YsmhLJ9mOnYTXzRdOIkX4gcw SF3w8qdke8nsPNUcSpUAy44/wuTdXFMY0d1fmrO+fwdOwMXUbFQdmulpIZbt9w== X-Google-Smtp-Source: AGHT+IG2tEyej5UQnOeefcV9e/U9YieQu0rWmY+J1mYcPTSkRT/g2bmdocy5leEtwNTQqcU/o/z4rw== X-Received: by 2002:a05:600c:154f:b0:414:1351:8662 with SMTP id f15-20020a05600c154f00b0041413518662mr1420263wmg.12.1711710317689; Fri, 29 Mar 2024 04:05:17 -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 h11-20020a05600c314b00b0041490467febsm8231415wmo.38.2024.03.29.04.05.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 29 Mar 2024 04:05:17 -0700 (PDT) Message-ID: <8330278b-9615-4030-8626-51ce714a7f54@enterprisedb.com> Date: Fri, 29 Mar 2024 12:05:15 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: BitmapHeapScan streaming read user and prelim refactoring To: Thomas Munro Cc: Melanie Plageman , Heikki Linnakangas , Andres Freund , Pg Hackers , Nazir Bilal Yavuz References: <5a172d1e-d69c-409a-b1fa-6521214c81c2@iki.fi> <20240323002211.on5vb5ulk6lsdb2u@liskov> <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> Content-Language: en-US From: Tomas Vondra In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 3/29/24 02:12, Thomas Munro wrote: > On Fri, Mar 29, 2024 at 10:43 AM Tomas Vondra > wrote: >> I think there's some sort of bug, triggering this assert in heapam >> >> Assert(BufferGetBlockNumber(hscan->rs_cbuf) == tbmres->blockno); > > Thanks for the repro. I can't seem to reproduce it (still trying) but > I assume this is with Melanie's v11 patch set which had > v11-0016-v10-Read-Stream-API.patch. > > Would you mind removing that commit and instead applying the v13 > stream_read.c patches[1]? v10 stream_read.c was a little confused > about random I/O combining, which I fixed with a small adjustment to > the conditions for the "if" statement right at the end of > read_stream_look_ahead(). Sorry about that. The fixed version, with > eic=4, with your test query using WHERE a < a, ends its scan with: > I'll give that a try. Unfortunately unfortunately the v11 still has the problem I reported about a week ago: ERROR: prefetch and main iterators are out of sync So I can't run the full benchmarks :-( but master vs. streaming read API should work, I think. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company