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 1sH5GS-002zoP-Uj for pgsql-hackers@arkaria.postgresql.org; Tue, 11 Jun 2024 17:26:33 +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 1sH5GR-008Dko-4D for pgsql-hackers@arkaria.postgresql.org; Tue, 11 Jun 2024 17:26:32 +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 1sH5GQ-008Dkf-M9 for pgsql-hackers@lists.postgresql.org; Tue, 11 Jun 2024 17:26:31 +0000 Received: from mail-qk1-x736.google.com ([2607:f8b0:4864:20::736]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sH5GK-000pFK-JQ for pgsql-hackers@lists.postgresql.org; Tue, 11 Jun 2024 17:26:30 +0000 Received: by mail-qk1-x736.google.com with SMTP id af79cd13be357-797f222c9f9so9515985a.3 for ; Tue, 11 Jun 2024 10:26:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wi3ck-info.20230601.gappssmtp.com; s=20230601; t=1718126782; x=1718731582; darn=lists.postgresql.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=r2pEybnCHUlVT+9TggIprOQ+cyL0RYflyLltcAMMJCw=; b=aroReqEXRTKhqXpdWckXr9xHOAKHZM7iCbN7duEAltXCs404HmyeJfLwKaBW1rVF19 KSgsT0l/9VJOiXYCAjNpdEOIuOBk1YEs3rb8gG9TFCRSUT7THaad0DoI6ysLppvC/U35 J9gG1robBgw+r4O32x2vkux0oZbikGNSJY8VqrBUdpDyfTaQIacuvQcf7Lio+3NoDV0E Fvhwmj/RoSW/WA/asAWe6WxgzWyUkpyaDn0HhvYKif3VUR6ipQ2J5CbT7A9QToyxPBA/ 4D6oiHgEzn9nAdJoOV3uLRc4BUZS4kKkErrgfnMmEeMst2hAeJgqMLi3ehn36QHytDse wHag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718126782; x=1718731582; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=r2pEybnCHUlVT+9TggIprOQ+cyL0RYflyLltcAMMJCw=; b=jbQFCxA+QaQlkgoSEbXmKc63ellhjuClTWfswsM+7m/YlqB0bSjm+JCsM5tDrXxFal BX9oBnO64eBAxsfKfmgYK3ZP905fc/z9nfy4scT8/cwFRWqhNg3SF6VGh3dD+rjh2l7e Ot7PL4P+nXb4pz8D3OTx7GT5PcOyHX/eF5l+V2SkxxrRIZMsRd7zaRyxoG3VKVDTpC2u 0iQ8G/xs0wTKL6G6HCrgEHZD7DM3DhvI/tLEWKf/1qiyOsDXSuCD+uHa9rapSgqoPp57 AGoik9HD+7PAX9pa2WFpKnJD9lv7Qk9LxSuHRp27RoMd2+uxIt19vf23wfbZNl3cm6jh Cpnw== X-Gm-Message-State: AOJu0Yx496bjUVqy1PnSYUM3EWf/CUZJydBTqPLKxgzbryPmr/g3NoB3 /3L+K0IF17gUkI3kB6yNyO8JCnR2gZCAhFtmEjgfgvl5GVir7v6NrgZPfvg/1ZcttgeguDB5u3J f X-Google-Smtp-Source: AGHT+IGyFW42xf1K6LCkjp4O0wbzqryOGME5pdwt4NcvN+ycCLFXU87QfzqsLpZ8Y+WdJAQjFpZLpQ== X-Received: by 2002:a05:6214:5782:b0:6b0:91d4:5821 with SMTP id 6a1803df08f44-6b091d46337mr14283106d6.28.1718126782302; Tue, 11 Jun 2024 10:26:22 -0700 (PDT) Received: from [172.21.0.10] (pool-173-49-58-32.phlapa.fios.verizon.net. [173.49.58.32]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6b07741241dsm28586846d6.135.2024.06.11.10.26.21 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 11 Jun 2024 10:26:21 -0700 (PDT) Message-ID: Date: Tue, 11 Jun 2024 13:26:20 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Track the amount of time waiting due to cost_delay To: pgsql-hackers@lists.postgresql.org References: Content-Language: en-US From: Jan Wieck In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 6/11/24 13:13, Robert Haas wrote: > On Tue, Jun 11, 2024 at 5:49 AM Bertrand Drouvot > wrote: >> As we can see the actual wait time is 30ms less than the intended wait time with >> this simple test. So I still think we should go with 1) actual wait time and 2) >> report the number of waits (as mentioned in [1]). Does that make sense to you? > > I like the idea of reporting the actual wait time better, provided > that we verify that doing so isn't too expensive. I think it probably > isn't, because in a long-running VACUUM there is likely to be disk > I/O, so the CPU overhead of a few extra gettimeofday() calls should be > fairly low by comparison. I wonder if there's a noticeable hit when > everything is in-memory. I guess probably not, because with any sort > of normal configuration, we shouldn't be delaying after every block we > process, so the cost of those gettimeofday() calls should still be > getting spread across quite a bit of real work. Does it even require a call to gettimeofday()? The code in vacuum calculates an msec value and calls pg_usleep(msec * 1000). I don't think it is necessary to measure how long that nap was. Regards, Jan