List:Internals« Previous MessageNext Message »
From:Heikki Tuuri Date:June 19 2004 9:59am
Subject:Re: Number of snapshots
View as plain text  
Danesh,

are you possibly a DB2 developer :)? DB2 for Unix was written at the IBM
Toronto labs.

Look at /innobase/include/read0read.h, /innobase/include/read0read.ic,
/innobase/include/read0read.c.

Currently there is no limit on the number of MVCC snapshots in InnoDB. The
number is only limited by disk space and the computer memory, because InnoDB
must keep the history information in its tablespace, and the 'read view'
object for each snapshot in memory as long as the snapshot is being used.

The 'read view' is at trx->read_view, and if it is not NULL, you can use
read_view_print() to print its contents to stderr.

Best regards,

Heikki Tuuri
Innobase Oy


/*************************************************************************
Prints a read view to stderr. */

void
read_view_print(
/*============*/
        read_view_t*    view);  /* in: read view */


/* Read view lists the trx ids of those transactions for which a consistent
read should not see the modifications to the database. */

struct read_view_struct{
        ibool   can_be_too_old; /* TRUE if the system has had to purge old
                                versions which this read view should be able
                                to access: the read view can bump into the
                                DB_MISSING_HISTORY error */  <---- NOT
CURRENTLY USED
        dulint  low_limit_no;   /* The view does not need to see the undo
                                logs for transactions whose transaction
number
                                is strictly smaller (<) than this value:
they
                                can be removed in purge if not needed by
other
                                views */
        dulint  low_limit_id;   /* The read should not see any transaction
                                with trx id >= this value */
        dulint  up_limit_id;    /* The read should see all trx ids which
                                are strictly smaller (<) than this value */
        ulint   n_trx_ids;      /* Number of cells in the trx_ids array */
        dulint* trx_ids;        /* Additional trx ids which the read should
                                not see: typically, these are the active
                                transactions at the time when the read is
                                serialized, except the reading transaction
                                itself; the trx ids in this array are in a
                                descending order */
        trx_t*  creator;        /* Pointer to the creating transaction, or
                                NULL if used in purge */
        UT_LIST_NODE_T(read_view_t) view_list;
                                /* List of read views in trx_sys */
};

From: Danesh Irani (dirani@stripped)
Subject: Number of snapshots
This is the only article in this thread
View: Original Format
Newsgroups: mailing.database.mysql-internals
Date: 2004-06-18 07:27:42 PST

--=_alternative 004DB82E85256EB7_=
Content-Type: text/plain; charset="US-ASCII"

Hello,

Does anyone know the max number of snapshots that mySQL will create when
using innodb tables (when using Repeatable Read Isolation mode)? Also is
there any way to determine on which 'version' a read is occurring on or if
not where would be the best place to put in code to report this
information.

Thanks,
-------------------------------------------------
Danesh Irani
IBM Toronto Lab
8200 Warden Ave, Markham, Ontario
Internal Address: B2/829/8200/MKM
--=_alternative 004DB82E85256EB7_=--

Thread
Number of snapshotsDanesh Irani18 Jun
Re: Number of snapshotsHeikki Tuuri19 Jun
  • Re: Number of snapshotsDanesh Irani13 Jul