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 1qx90l-00GK8r-VI for pgsql-general@arkaria.postgresql.org; Sun, 29 Oct 2023 16:51:39 +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 1qx90k-008XEZ-FK for pgsql-general@arkaria.postgresql.org; Sun, 29 Oct 2023 16:51:38 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qx90k-008XEQ-3t for pgsql-general@lists.postgresql.org; Sun, 29 Oct 2023 16:51:38 +0000 Received: from mail-yb1-xb35.google.com ([2607:f8b0:4864:20::b35]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qx90h-002ux8-DC for pgsql-general@lists.postgresql.org; Sun, 29 Oct 2023 16:51:36 +0000 Received: by mail-yb1-xb35.google.com with SMTP id 3f1490d57ef6-da2e786743aso691209276.0 for ; Sun, 29 Oct 2023 09:51:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698598294; x=1699203094; darn=lists.postgresql.org; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=x/bvyNwn+FxwCKDVzydDy/bx/rEE5CJv1EHIoH8u+LQ=; b=aQO5oCXIesv1blquC1oSi+KkLND+yGUOkGuBfCLRt+kOGrr3SeDgZp3hHHqD/LQyYJ D0JMb6Ahzu+r9A5yxQusvJzDBXoN4dPTsjZJ1mWj3YeQSECSFVCaYtpZKNIYEOA1pml9 Mg8ZwfocGtuOiIMf4+uJ78vIlRDmvF+Z6h1ngD5zBYSG/zyM5tbJMc9Rt9XQ8BUlcpRk XYQ4bkWldIf/8lmRzd31kh2pysb8UsQH5eg655doRkpFlyrSC0Ned+yKGFKxWmKT3lFQ oTYfH7GB8Y3dymXxP1ly9ol5gFFKmgYdMWQH0DxwgOa2MP8y5vTqZRsQY6/qH10DmUXI nEYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698598294; x=1699203094; h=content-transfer-encoding:in-reply-to:from:references: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=x/bvyNwn+FxwCKDVzydDy/bx/rEE5CJv1EHIoH8u+LQ=; b=j4rMcgyuqphqrbJisu4eTNQf34TkwomUo6B2uGztfU6Zlvly/fwkHycuQYa5goi90/ W5qdSyCoo8K0yo5rpYmT5qZ/SBt28Pp0nGCpF2SdjPwKQBBcC1gFmnQ54EluMnYygtzH 7aIermMci4Fp6bbasQ0gMUg0KxbsC9PlIEs4IBXQX5p0yTWv4dMi5vx0Dycria4DMO9A 6ovLK4lgwRb0aVcQSejP1XDHoXuEpvGVwGFAvA7GFdmttSqepEIPAy5/2ORSwxWMvnF/ VFJgBPC/xCFx874IFXNjRsfzZ3eePpeFqNHjrCgN1rFgke1XZoFPQPbTmXJxTpYqQS8m U2Zw== X-Gm-Message-State: AOJu0Yy6hNOnVxvdzsr1jZcu14oJxeelZwdwgsZvzO/eAzt6xWoSH0bc HtW7B2yF3ULLPXn9cIwB8BG5vlvK87A= X-Google-Smtp-Source: AGHT+IGd8GE25yeM3JZKmR+iTzXSjcnNe8YEYda6/Di6l2YpWJw3mjrzSwCPz8djsL1Qy4ieESnCMQ== X-Received: by 2002:a25:900f:0:b0:d9b:2ca7:4cd8 with SMTP id s15-20020a25900f000000b00d9b2ca74cd8mr6187213ybl.31.1698598294124; Sun, 29 Oct 2023 09:51:34 -0700 (PDT) Received: from ?IPV6:2600:1700:bd2c:b810:d564:3b8d:339c:be87? ([2600:1700:bd2c:b810:d564:3b8d:339c:be87]) by smtp.googlemail.com with ESMTPSA id a20-20020a25ae14000000b00d9ca7c2c8e2sm2886873ybj.11.2023.10.29.09.51.33 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 29 Oct 2023 09:51:33 -0700 (PDT) Message-ID: <39d83a8e-36ef-41f7-825c-4ce290b59fd4@gmail.com> Date: Sun, 29 Oct 2023 11:51:32 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [SOLVED?] Re: Disk wait problem... not hardware... Content-Language: en-US To: pgsql-general@lists.postgresql.org References: <20231023175529.59f309bb@pfortin.com> <9938ff1a-8837-454b-a50c-a748e84c172a@aklaver.com> <20231026095000.4swq6vbgdsw3palp@hjp.at> <20231026155016.6b739a7e.pfortin@pfortin.com> <20231026220325.2204a3f6.pfortin@pfortin.com> <20231027170711.xgz3xrf7cujx7udh@hjp.at> <20231027194609.1bf96324.pfortin@pfortin.com> <20231029092146.53351f7e@pfortin.com> <20231029151605.kijo6gumeen7jj26@hjp.at> <20231029124508.71a8ce22.pfortin@pfortin.com> From: Ron In-Reply-To: <20231029124508.71a8ce22.pfortin@pfortin.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 10/29/23 11:45, pf@pfortin.com wrote: > On Sun, 29 Oct 2023 16:16:05 +0100 Peter J. Holzer wrote: > >> On 2023-10-29 09:21:46 -0400, pf@pfortin.com wrote: >>> These are all static tables. Does PG maintain a table row count so as to >>> avoid having to count each time? >> No. To count the rows in a table, Postgres has to actually read the >> whole table (or an index, if a suitable index (e.g. a primary key) >> exists). > Am I correct to assume count(fieldname) would only load that column for > counting? The OS reads (chunks of) blocks, not individual bytes, and Postgresql is record oriented, not column-oriented. > In other words: we should be specific (avoid "*") in general? No. -- Born in Arizona, moved to Babylonia.