pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: merryok <merryok@163.com>
To: Peter J. Holzer <hjp-pgsql@hjp.at>
Cc: pgsql-general@lists.postgresql.org
Subject: Re:Re: equivalent thing of mtr in mysql
Date: Sat, 16 Jul 2022 09:31:19 +0800 (CST)
Message-ID: <2c01c02b.8c7.18204a1a906.Coremail.merryok@163.com> (raw)
In-Reply-To: <20220712185728.vubbosjtlgffs2th@hjp.at>
References: <4114f05b.8c8d.181f2d9d679.Coremail.merryok@163.com>
	<20220712185728.vubbosjtlgffs2th@hjp.at>

I'm sorry, first time to post a thread. mtr is short for mini-transaction.
About mtr in mysql, we can refer to https://dev.mysql.com/doc/refman/8.0/en/glossary.html or
 https://dev.mysql.com/blog-archive/mysql-8-0-new-lock-free-scalable-wal-design/ 




So an insert in mysql,  wrapped in a user transaction, may result in multiple mini-transactions, one is responsible for writing redo for undo, the other one for writing redo for clustered index/secondary index, and so on. Each mtr may modify multiple pages,  whose redo logs are guaranteed by mtr to be written into disk or none of them are written.











At 2022-07-13 02:57:28, "Peter J. Holzer" <hjp-pgsql@hjp.at> 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 ?
>
>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
>
>-- 
>   _  | Peter J. Holzer    | Story must make more sense than reality.
>|_|_) |                    |
>| |   | hjp@hjp.at         |    -- Charles Stross, "Creative writing
>__/   | http://www.hjp.at/ |       challenge!"


view thread (8+ messages)  latest in thread

Message-ID: <2c01c02b.8c7.18204a1a906.Coremail.merryok@163.com>
Permalink:  ../2c01c02b.8c7.18204a1a906.Coremail.merryok@163.com/
Also on:    postgresql.org/message-id/2c01c02b.8c7.18204a1a906.Coremail.merryok@163.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: merryok@163.com, hjp-pgsql@hjp.at
  Subject: Re: equivalent thing of mtr in mysql
  In-Reply-To: <2c01c02b.8c7.18204a1a906.Coremail.merryok@163.com>
  References: <4114f05b.8c8d.181f2d9d679.Coremail.merryok@163.com> <20220712185728.vubbosjtlgffs2th@hjp.at> <2c01c02b.8c7.18204a1a906.Coremail.merryok@163.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox