MySQL Architecture Flashcards
Which of the following is true, regarding The buffer pool:
a) The buffer pool is an area in main memory where InnoDB caches table data as it is accessed
b) The buffer pool is an area in main memory where InnoDB caches index data as it is accessed
c) The buffer pool permits frequently used data to be accessed directly from memory
d) All of the above
e) none of the above
Answer: D
all of the above.
The buffer pool is an area in main memory where InnoDB caches table and index data as it is accessed. The buffer pool permits frequently used data to be accessed directly from memory, which speeds up processing. On dedicated servers, up to 80% of physical memory is often assigned to the buffer pool.
Buffers specific to InnoDB are configured using the following parameters
a) key_buffer_size
b) innodb_log_buffer_size
c) innodb_buffer_pool_size
d) both a and b
e) both b and c
f) all three a, b and c
Answer: e
key_buffer_size is for MyISAM , not InnoDB.
Buffers specific to InnoDB are configured using the following parameters:
innodb_buffer_pool_size defines size of the buffer pool, which is the memory area that holds cached data for InnoDB tables, indexes, and other auxiliary buffers. The size of the buffer pool is important for system performance,
and it is typically recommended that innodb_buffer_pool_size is configured to 50 to 75 percent of system memory. The default buffer pool size is 128MB.
On systems with a large amount of memory, you can improve concurrency by dividing the buffer pool into multiple buffer pool instances.
The number of buffer pool instances is controlled by the by innodb_buffer_pool_instances option. By default, InnoDB creates one buffer pool instance. The number of buffer pool instances can be configured at startup.
innodb_log_buffer_size defines the size of the buffer that InnoDB uses to write to the log files on disk. The default size is 16MB. A large log buffer enables large transactions to run without writing the log to disk before the transactions commit. If you have transactions that update, insert, or delete many rows, you might consider increasing the size of the log buffer to save disk I/O. innodb_log_buffer_size can be configured at startup.
Memory area that holds data to be written to the log files on disk.
a) change buffer
b) log buffer
c) innodb_buffer_pool_size
d) buffer_pool
Answer: b
The log buffer is the memory area that holds data to be written to the log files on disk. Log buffer size is defined by the innodb_log_buffer_size variable. The default size is 16MB. The contents of the log buffer are periodically flushed to disk. A large log buffer enables large transactions to run without the need to write redo log data to disk before the transactions commit. Thus, if you have transactions that update, insert, or delete many rows, increasing the size of the log buffer saves disk I/O.
A special data structure used for caching changes in secondary index pages that are not in the buffer pool.
a) change buffer
b) clustered indexes
c) log buffer
d) buffer pool
Answer: a
The change buffer is a special data structure that caches changes to secondary index pages when those pages are not in the buffer pool. The buffered changes, which may result from INSERT, UPDATE, or DELETE operations (DML), are merged later when the pages are loaded into the buffer pool by other read operations.
Which of the following is false, regarding the change buffer
a) Change buffering is supported for a secondary index if the index contains a descending index column
b) the change buffer occupies part of the buffer pool
c) On disk, the change buffer is part of the system tablespace,
d) Change buffering is not supported if the primary key includes a descending index column
Answer : a
Change buffering is not supported for a secondary index if the index contains a descending index column or if the primary key includes a descending index column.
In memory, the change buffer occupies part of the buffer pool. On disk, the change buffer is part of the system tablespace, where index changes are buffered when the database server is shut down.
Each database has a data directory located under database directory.
a) True
b) False
Answer: a
Explanation: In MySQL, each database has a database directory that is located under the data directory. The tables, views and triggers within a database correspond to files in the database directory.
In Mysql 8.0.x
In the database directory (datadir) of the database each view and trigger object creates how many files?
a) 0
b) 1
c) 2
d) 3
Answer: a
in older versions of Mysql there was a .frm file. in MySQL8 we do not have FRM files, they were dropped
Oracle has moved the FRM information—and more—to what is called Serialized Dictionary Information (SDI), the SDI is written INSIDE the ibd file, and represents the redundant copy of the information contained in the data dictionary.
What is the maximum number of characters allowed for a database name to have?
a) 16
b) 32
c) 64
d) 128
Answer: c
Explanation: MySQL allows the database names and the table names to be a maximum of 64 characters long. The length of these names is also bound by the length allowed by the operating system on the machine.
What is the maximum number of characters allowed for a User-Defined Variable to have?
a) 16
b) 32
c) 64
d) 128
Answer: c
Explanation: MySQL allows theUser-Defined Variable to be a maximum of 64 characters long. The length of these names is also bound by the length allowed by the operating system on the machine.
In MySQL, identifier names can start with a digit.
a) True
b) False
Answer: a
Explanation: Identifiers are allowed to start with any legal character. So it may begin with a digit. The special characters in the identifier characters consist of the ‘_’ and ‘$’. The other characters are the alphanumeric characters.
To verify plugin installation use the following command in the mysql shell?
a) SHOW PLUGINS
b) SHOW VARIABLES ‘PLUGINS’;
c) SHOW GLOBAL VARIABLES ‘PLUGINS’;
d) SELECT plugins();
Answer: a
mysql> show plugins;
+———————————+———-+——————–+———+————-+
| Name | Status | Type | Library | License |
+———————————+———-+——————–+———+————-+
| binlog | ACTIVE | STORAGE ENGINE | NULL | PROPRIETARY |
| mysql_native_password | ACTIVE | AUTHENTICATION | NULL | PROPRIETARY |
| sha256_password | ACTIVE | AUTHENTICATION | NULL | PROPRIETARY |
| caching_sha2_password | ACTIVE | AUTHENTICATION | NULL | PROPRIETARY |
| sha2_cache_cleaner | ACTIVE | AUDIT | NULL | PROPRIETARY |
| daemon_keyring_proxy_plugin | ACTIVE | DAEMON | NULL | PROPRIETARY |
| CSV | ACTIVE | STORAGE ENGINE | NULL | PROPRIETARY |
| MEMORY | ACTIVE | STORAGE ENGINE | NULL | PROPRIETARY |
| InnoDB | ACTIVE | STORAGE ENGINE | NULL | PROPRIETARY |
| INNODB_TRX | ACTIVE | INFORMATION SCHEMA | NULL | PROPRIETARY |
During the installation of MySQL there are some user accounts created.
a) True
b) False
Answer: a
One part of the MySQL installation process is data directory initialization . During data directory initialization, MySQL creates user accounts that should be considered reserved:
‘root’@’localhost: Used for administrative purposes. This account has all privileges, is a system account, and can perform any operation.
Strictly speaking, this account name is not reserved, in the sense that some installations rename the root account to something else to avoid exposing a highly privileged account with a well-known name.
‘mysql.sys’@’localhost’: Used as the DEFINER for sys schema objects. Use of the mysql.sys account avoids problems that occur if a DBA renames or removes the root account. This account is locked so that it cannot be used for client connections.
‘mysql.session’@’localhost’: Used internally by plugins to access the server. This account is locked so that it cannot be used for client connections. The account is a system account.
‘mysql.infoschema’@’localhost’: Used as the DEFINER for INFORMATION_SCHEMA views. Use of the mysql.infoschema account avoids problems that occur if a DBA renames or removes the root account. This account is locked so that it cannot be used for client connections.
Which user account is used internally by plugins to access the server. This account is locked so that it cannot be used for client connections. The account is a system account.
a) ‘mysql.infoschema’@’localhost
b) ‘mysql.session’@’localhost’
c) ‘mysql.sys’@’localhost’
d) ‘mysql.plugins’
Answer: b
‘mysql.session’@’localhost’: Used internally by plugins to access the server. This account is locked so that it cannot be used for client connections. The account is a system account.
Which of the following is NOT a Reserved Account created during the MySQL installation and initialization?
a) ‘mysql.infoschema’@’localhost
b) ‘root’@’localhost
c) ‘mysql.session’@’localhost’
d) ‘mysql.sys’@’localhost’
One part of the MySQL installation process is data directory initialization. During data directory initialization, MySQL creates user accounts that should be considered reserved:
‘root’@’localhost: Used for administrative purposes. This account has all privileges, is a system account, and can perform any operation.
Strictly speaking, this account name is not reserved, in the sense that some installations rename the root account to something else to avoid exposing a highly privileged account with a well-known name.
In MySQL 8.0, the default authentication plugin is:
a) mysql_native_password
b) mysql_native_strict
c) mysql_sha2_password
d caching_sha2_password
Answer : d
In MySQL 8.0, the default authentication plugin has changed from mysql_native_password to caching_sha2_password, and the ‘root’@’localhost’ administrative account uses caching_sha2_password by default.