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 1tqBJ2-000kJE-DA for pgsql-hackers@arkaria.postgresql.org; Thu, 06 Mar 2025 13:30:32 +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 1tqBIz-00BZzW-Tf for pgsql-hackers@arkaria.postgresql.org; Thu, 06 Mar 2025 13:30: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 1tqBIz-00BZzO-Jn for pgsql-hackers@lists.postgresql.org; Thu, 06 Mar 2025 13:30:29 +0000 Received: from mail-lj1-x22c.google.com ([2a00:1450:4864:20::22c]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tqBIv-001IpV-2x for pgsql-hackers@lists.postgresql.org; Thu, 06 Mar 2025 13:30:29 +0000 Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-30b9b1979b9so6920191fa.1 for ; Thu, 06 Mar 2025 05:30:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741267826; x=1741872626; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=xvhx8Smmf9y4N5ovthFyrcXR9rtAA070/q0+TPU+Xt4=; b=KI8xRKben+7n5iPguX9GoNPFh41ceGnKn3lVM/yC8TZS+8JZLCojBABUQcGkhqwPUf OA458msyZvQLxtbrFf6va3oLf23Ic53zQUh74qucUwi4sk1F0g7fxBI4bHvOBhQ0zjs4 j+7ToBivytVI3huPFkdmV92OFIZbxdLCCfsgR0qt4ins0K47QSBUGP4FdDE6GF4P20ae lvgODmS70biKAx2DslcBVJXtB+xy3/+qf6iwfwReTTunCBKELoj1d/7ur9tLkKzgnmin 50wS2iyRZX0d4rlt7WbW4EiMaG6SkI1LXODT9Maso/ygKhAiH+6Ma+0ycUX5tN/ho/TN Talg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741267826; x=1741872626; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=xvhx8Smmf9y4N5ovthFyrcXR9rtAA070/q0+TPU+Xt4=; b=cLR/G36Lpyngd7xmkzpefU/uiP/yaxHoNOVYw23a5GmndOnkHobOruheVtVZh24EYy 7HvEwDtBdLSjiKshrfM66bosZnK7pBf9nWEK//FsKND27hlM+QkFJyb2WPEBjvH4rp/h YtvjDOMu6oqEuBHCzeWysvwCbZQ9NZ6nXOMUtLi1JIrT4/lD/8k02+mDY+MDH1onxQKR LSY+GlDRWHF9oEF0ngmXMosXwo+12MoSM6mctsAq5cTOpGshbyxNIYJf7MavtbDKU7f4 VqjqsFHMZE1fJrWG23YDz5PRBeLPW4/ESFJy3UXFbFJIbeMw/QMbcgxBrFQDQZWyANcj QyBg== X-Forwarded-Encrypted: i=1; AJvYcCXx2pBgIPDgKsgojqQnWywIMiiOZSqzySrEaYQNOBfnNXUzdERsd3HmDMCjGD2ozwAjH4o9DRsFf5Zq28I4@lists.postgresql.org X-Gm-Message-State: AOJu0Yx/4nsn3EL224yQxDyyqTwxC6bZ60r7HWeG6J6z7JBq11rhgrJe 9PEzuU6wQvTdn3tIHztThaPVzfRfZIBj1alxedoeQ3XtdZ+AbJ9gJZ7OOCbXbFSk/PNS8rEIoyL zPyzmrPnBYcM7adYbnVAoV8HgOTQ= X-Gm-Gg: ASbGncutWoK+GHArz1yByu6249OvWoW9kVNCv1GRj0cVuQIw362h9f8fnmdUuPdppUW L8jNjKjXHxz8DZyZFCccDx0NVOaA3t4UsLbkZ73xQt+tMaTuyJiXUB28UtIrVFXKObzuxxdkEKa QkI6sYeSZMjI3bi/LeO1JexbPeSw== X-Google-Smtp-Source: AGHT+IGOzQ5yFFEC04wZF2VfPhlRAYc2npDzgtQEfrS4Eud2efrXjGcxr9Mnfku91GqEpOD8abVs7e8VQ5bvBCp1Apc= X-Received: by 2002:a05:651c:150b:b0:30b:c637:fcb7 with SMTP id 38308e7fff4ca-30bd7a1f0a9mr25596051fa.4.1741267825796; Thu, 06 Mar 2025 05:30:25 -0800 (PST) MIME-Version: 1.0 References: <01ec86c1-e04b-4cbe-b641-22cae8b87604@tantorlabs.com> <73e2440e-7d8b-4860-974d-931a93326d95@gmail.com> <3737950.1740182671@sss.pgh.pa.us> <3816053.1740190267@sss.pgh.pa.us> <40663fc5-edac-4b45-a2aa-a76976700ed9@tantorlabs.com> In-Reply-To: From: Matthias van de Meent Date: Thu, 6 Mar 2025 14:30:13 +0100 X-Gm-Features: AQ5f1Jq3evyEQinxqN1vFk9yw2D2-7ivCUAa4Ph45kgKMf3GLsXDbkabw5W1foU Message-ID: Subject: Re: explain analyze rows=%.0f To: Alena Rybakina Cc: Ilia Evdokimov , Robert Haas , Tom Lane , Andrei Lepikhov , pgsql-hackers@lists.postgresql.org, Guillaume Lelarge , Matheus Alcantara Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, 6 Mar 2025 at 14:18, Alena Rybakina wrote: > > Hi! I got a query plan with a strange number of rows. Could you please > help me understand it? > > To be honest I can't understand why 0.50 number of rows here? Because the scan matched only ~(500 rows over 999 iterations = 500/999 ~=) 0.50 rows for every loop, on average, for these plan nodes: > -> Nested Loop (actual rows=0.50 loops=999) > -> Seq Scan on tb (actual rows=0.50 loops=999) And for this, it was 500 rows total in 1000 iterations, which also rounds to 0.50: > SubPlan 2 > -> Result (actual rows=0.50 loops=1000) > One-Time Filter: ((ta1.id < 1000) AND (InitPlan 1).col1) As of ddb17e38 (and its follow-up 95dbd827), we display fractional rows-per-loop, with 2 digits of precision, rather than a rounded integer. This allows a user to distinguish plan nodes with 0.49 rows/loop and 0.01 rows/loop, and that can help inform the user about how to further optimize their usage of indexes and other optimization paths. Kind regards, Matthias van de Meent Neon (https://neon.tech)