Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oBLEe-0002IN-MP for pgsql-general@arkaria.postgresql.org; Tue, 12 Jul 2022 19:07:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oBLEd-0004qW-Ig for pgsql-general@arkaria.postgresql.org; Tue, 12 Jul 2022 19:07:51 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oBLEd-0004pL-5u for pgsql-general@lists.postgresql.org; Tue, 12 Jul 2022 19:07:51 +0000 Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oBLEY-00045r-TR for pgsql-general@lists.postgresql.org; Tue, 12 Jul 2022 19:07:50 +0000 Received: by mail-pg1-x52e.google.com with SMTP id bf13so8395234pgb.11 for ; Tue, 12 Jul 2022 12:07:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to; bh=uIQ/BaO/29t19nXUuQyGYohOJbmGMOzttovtmD7009w=; b=X5ZiB/V8NpJr+1j9xlaXFhGGtMktto8dzdcRMEGJBJZnnu1hgNL6PN2+J8qBQqzSFI WIiYYLK+qCrfmjxyvaNMg9vEPvYowqn/dWUq0FryBQ/hTwpuofDZar0zs6m1NZIAVwuD p/5VOFGGU2UptA7LgTctw4VSyMxtznLZ+nFoK5HTRXOoVYp60TNc+uqkIipJu4je8V6f DgjVL0Fhd2kSAfeKy2PAyHmSO1QIyE+Vq5L6VFhjo9gbGaWFHBNkoUlTp4AKhr+vmiXj 7u2v6UAwoHqBApkLDwiIptKemJIMvsIZ0eed6N58SlSam/Y6iWGIToTpRG2n9vOA33Rt WGCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to; bh=uIQ/BaO/29t19nXUuQyGYohOJbmGMOzttovtmD7009w=; b=CjPn9xAgI6ZU+5RwnfrHxVJNR3XN8QKge25qjJyOLY+mrrGomsvhxMZyjpM09qDggv hT5SxTGaYXjz5CbyeIIaUexX5wJ4MVbSjNkTHnmDmr/OcNFJoyUzcpToTknFZEw5R0M1 aAka4yuezN/JTLyKELAm1nSqA9G/NyANMTEWmV7V9XBazGA+DtjlPRFwZpW8z80nW2sr oqjJJW2Tx+ehq9l3nzze0YQUoRtqEyLtxCGVw79rKzS25u+9+xL3XovccxEhxTfqHrp3 Asq6lVRR1R5TICkBSeZEu8N/4DT5Qp2Gs41DQZLTGWGF+40bj2KM7LMOha0i8jMwxyOd VODQ== X-Gm-Message-State: AJIora/lAwWjlbvB35vHGFhBph62RlOK7aTcM1kcSBkbKkB6bzErLwrz kT1Pl+nM85Ge8ItMScIQCSqxf8NgSN4= X-Google-Smtp-Source: AGRyM1uS28bvceZNSKT8ylYsBZ7Yfm7cE2zcj2RZkeV8OYipiNe11rZTtSEBXuE1kfbWeU5gDCWZmw== X-Received: by 2002:a05:6a00:b8b:b0:51b:eefc:7fd2 with SMTP id g11-20020a056a000b8b00b0051beefc7fd2mr25001408pfj.74.1657652863872; Tue, 12 Jul 2022 12:07:43 -0700 (PDT) Received: from [10.128.56.157] ([155.98.131.5]) by smtp.gmail.com with ESMTPSA id mr2-20020a17090b238200b001ef8912f763sm7151490pjb.7.2022.07.12.12.07.42 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 12 Jul 2022 12:07:43 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------TcaSaKX0kBue9X0ln0foax8Z" Message-ID: <67edc741-da51-e404-b002-c6a47b542d25@gmail.com> Date: Tue, 12 Jul 2022 13:07:41 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: equivalent thing of mtr in mysql Content-Language: en-CA To: pgsql-general@lists.postgresql.org References: <4114f05b.8c8d.181f2d9d679.Coremail.merryok@163.com> <20220712185728.vubbosjtlgffs2th@hjp.at> From: Rob Sargent In-Reply-To: <20220712185728.vubbosjtlgffs2th@hjp.at> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------TcaSaKX0kBue9X0ln0foax8Z Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 7/12/22 12:57, Peter J. Holzer wrote: > On 2022-07-12 22:39:31 +0800, merryok wrote: >> Hi, guys. I'm new here. >> >> I'm eager to figure out what is the equivalent thing of mtr in mysql in PG. > What is MTR? A search for "mtr mysql" yields "mysql test run" and > "multi-threaded replication", neither of which seems to be what you are > talking about. When referring to concepts from other databases, please > include a link to the relevant documentation. > >> When a dml operation occurs, it may modify multiple pages and gererate multiple >> redo log records. mtr can make those logs atomically be transferred to log >> buffer and written to disk. >> I think same situation exists in PG, but I can't find something like mtr, why ? I thought OP was hinting at WAL stuff defn here > Transactions in PostgreSQL are always atomic (That should also be the > case with MySQL, unless you use MyISAM tables). Ensuring that these > changes also result in an atomic disk write seems to be both pointless > and impossible (that might be many gigabytes of data). > > hp > --------------TcaSaKX0kBue9X0ln0foax8Z Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit
On 7/12/22 12:57, Peter J. Holzer wrote:
On 2022-07-12 22:39:31 +0800, merryok wrote:
Hi, guys. I'm new here.

I'm eager to figure out what is the equivalent thing of mtr in mysql in PG.
What is MTR? A search for "mtr mysql" yields "mysql test run" and
"multi-threaded replication", neither of which seems to be what you are
talking about. When referring to concepts from other databases, please
include a link to the relevant documentation.

When a dml operation occurs, it may modify multiple pages and gererate multiple
redo log records. mtr can make those logs atomically be transferred to log
buffer and written to disk. 
I think same situation exists in PG, but I can't find something like mtr, why ?

I thought OP was hinting at WAL stuff defn here
Transactions in PostgreSQL are always atomic (That should also be the
case with MySQL, unless you use MyISAM tables). Ensuring that these
changes also result in an atomic disk write seems to be both pointless
and impossible (that might be many gigabytes of data).

        hp


--------------TcaSaKX0kBue9X0ln0foax8Z--