| 1 |
DESC sys.schema_auto_increment_columns; |
| 2 |
Field Type Null Key Default Extra |
| 3 |
table_schema varchar(64) YES NULL |
| 4 |
table_name varchar(64) YES NULL |
| 5 |
column_name varchar(64) YES NULL |
| 6 |
data_type longtext YES NULL |
| 7 |
column_type mediumtext NO NULL |
| 8 |
is_signed int NO 0 |
| 9 |
is_unsigned int NO 0 |
| 10 |
max_value bigint unsigned YES NULL |
| 11 |
auto_increment bigint unsigned YES NULL |
| 12 |
auto_increment_ratio decimal(25,4) unsigned YES NULL |
| 13 |
SELECT * FROM sys.schema_auto_increment_columns; |
| 14 |
CREATE DATABASE auto_incs; |
| 15 |
CREATE TABLE auto_incs.tinyintcol ( |
| 16 |
id TINYINT AUTO_INCREMENT PRIMARY KEY, |
| 17 |
foo INT |
| 18 |
); |
| 19 |
INSERT INTO auto_incs.tinyintcol (foo) VALUES (100); |
| 20 |
INSERT INTO auto_incs.tinyintcol (foo) (SELECT foo FROM auto_incs.tinyintcol); |
| 21 |
INSERT INTO auto_incs.tinyintcol (foo) (SELECT foo FROM auto_incs.tinyintcol); |
| 22 |
INSERT INTO auto_incs.tinyintcol (foo) (SELECT foo FROM auto_incs.tinyintcol); |
| 23 |
INSERT INTO auto_incs.tinyintcol (foo) (SELECT foo FROM auto_incs.tinyintcol); |
| 24 |
CREATE TABLE auto_incs.tinyintcolunsigned ( |
| 25 |
id TINYINT UNSIGNED AUTO_INCREMENT PRIMARY KEY, |
| 26 |
foo INT |
| 27 |
); |
| 28 |
INSERT INTO auto_incs.tinyintcolunsigned (foo) (SELECT foo FROM auto_incs.tinyintcol); |
| 29 |
CREATE TABLE auto_incs.smallintcol ( |
| 30 |
id SMALLINT AUTO_INCREMENT PRIMARY KEY, |
| 31 |
foo INT |
| 32 |
); |
| 33 |
INSERT INTO auto_incs.smallintcol (foo) VALUES (200); |
| 34 |
INSERT INTO auto_incs.smallintcol (foo) (SELECT foo FROM auto_incs.smallintcol); |
| 35 |
INSERT INTO auto_incs.smallintcol (foo) (SELECT foo FROM auto_incs.smallintcol); |
| 36 |
INSERT INTO auto_incs.smallintcol (foo) (SELECT foo FROM auto_incs.smallintcol); |
| 37 |
INSERT INTO auto_incs.smallintcol (foo) (SELECT foo FROM auto_incs.smallintcol); |
| 38 |
INSERT INTO auto_incs.smallintcol (foo) (SELECT foo FROM auto_incs.smallintcol); |
| 39 |
INSERT INTO auto_incs.smallintcol (foo) (SELECT foo FROM auto_incs.smallintcol); |
| 40 |
INSERT INTO auto_incs.smallintcol (foo) (SELECT foo FROM auto_incs.smallintcol); |
| 41 |
INSERT INTO auto_incs.smallintcol (foo) (SELECT foo FROM auto_incs.smallintcol); |
| 42 |
INSERT INTO auto_incs.smallintcol (foo) (SELECT foo FROM auto_incs.smallintcol); |
| 43 |
INSERT INTO auto_incs.smallintcol (foo) (SELECT foo FROM auto_incs.smallintcol); |
| 44 |
INSERT INTO auto_incs.smallintcol (foo) (SELECT foo FROM auto_incs.smallintcol); |
| 45 |
CREATE TABLE auto_incs.smallintcolunsigned ( |
| 46 |
id SMALLINT UNSIGNED AUTO_INCREMENT PRIMARY KEY, |
| 47 |
foo INT |
| 48 |
); |
| 49 |
INSERT INTO auto_incs.smallintcolunsigned (foo) (SELECT foo FROM auto_incs.smallintcol); |
| 50 |
CREATE TABLE auto_incs.mediumintcol ( |
| 51 |
id MEDIUMINT AUTO_INCREMENT PRIMARY KEY, |
| 52 |
foo INT |
| 53 |
); |
| 54 |
INSERT INTO auto_incs.mediumintcol (foo) VALUES (300); |
| 55 |
INSERT INTO auto_incs.mediumintcol (foo) (SELECT foo FROM auto_incs.mediumintcol); |
| 56 |
INSERT INTO auto_incs.mediumintcol (foo) (SELECT foo FROM auto_incs.mediumintcol); |
| 57 |
INSERT INTO auto_incs.mediumintcol (foo) (SELECT foo FROM auto_incs.mediumintcol); |
| 58 |
INSERT INTO auto_incs.mediumintcol (foo) (SELECT foo FROM auto_incs.mediumintcol); |
| 59 |
INSERT INTO auto_incs.mediumintcol (foo) (SELECT foo FROM auto_incs.mediumintcol); |
| 60 |
INSERT INTO auto_incs.mediumintcol (foo) (SELECT foo FROM auto_incs.mediumintcol); |
| 61 |
INSERT INTO auto_incs.mediumintcol (foo) (SELECT foo FROM auto_incs.mediumintcol); |
| 62 |
INSERT INTO auto_incs.mediumintcol (foo) (SELECT foo FROM auto_incs.mediumintcol); |
| 63 |
INSERT INTO auto_incs.mediumintcol (foo) (SELECT foo FROM auto_incs.mediumintcol); |
| 64 |
INSERT INTO auto_incs.mediumintcol (foo) (SELECT foo FROM auto_incs.mediumintcol); |
| 65 |
INSERT INTO auto_incs.mediumintcol (foo) (SELECT foo FROM auto_incs.mediumintcol); |
| 66 |
INSERT INTO auto_incs.mediumintcol (foo) (SELECT foo FROM auto_incs.mediumintcol); |
| 67 |
INSERT INTO auto_incs.mediumintcol (foo) (SELECT foo FROM auto_incs.mediumintcol); |
| 68 |
INSERT INTO auto_incs.mediumintcol (foo) (SELECT foo FROM auto_incs.mediumintcol); |
| 69 |
INSERT INTO auto_incs.mediumintcol (foo) (SELECT foo FROM auto_incs.mediumintcol); |
| 70 |
INSERT INTO auto_incs.mediumintcol (foo) (SELECT foo FROM auto_incs.mediumintcol); |
| 71 |
INSERT INTO auto_incs.mediumintcol (foo) (SELECT foo FROM auto_incs.mediumintcol); |
| 72 |
CREATE TABLE auto_incs.mediumintcolunsigned ( |
| 73 |
id MEDIUMINT UNSIGNED AUTO_INCREMENT PRIMARY KEY, |
| 74 |
foo INT |
| 75 |
); |
| 76 |
INSERT INTO auto_incs.mediumintcolunsigned (foo) (SELECT foo FROM auto_incs.mediumintcol); |
| 77 |
CREATE TABLE auto_incs.intcol ( |
| 78 |
id INT AUTO_INCREMENT PRIMARY KEY, |
| 79 |
foo INT |
| 80 |
); |
| 81 |
INSERT INTO auto_incs.intcol (foo) VALUES (400); |
| 82 |
INSERT INTO auto_incs.intcol (foo) (SELECT foo FROM auto_incs.intcol); |
| 83 |
INSERT INTO auto_incs.intcol (foo) (SELECT foo FROM auto_incs.intcol); |
| 84 |
INSERT INTO auto_incs.intcol (foo) (SELECT foo FROM auto_incs.intcol); |
| 85 |
INSERT INTO auto_incs.intcol (foo) (SELECT foo FROM auto_incs.intcol); |
| 86 |
INSERT INTO auto_incs.intcol (foo) (SELECT foo FROM auto_incs.intcol); |
| 87 |
INSERT INTO auto_incs.intcol (foo) (SELECT foo FROM auto_incs.intcol); |
| 88 |
INSERT INTO auto_incs.intcol (foo) (SELECT foo FROM auto_incs.intcol); |
| 89 |
INSERT INTO auto_incs.intcol (foo) (SELECT foo FROM auto_incs.intcol); |
| 90 |
INSERT INTO auto_incs.intcol (foo) (SELECT foo FROM auto_incs.intcol); |
| 91 |
INSERT INTO auto_incs.intcol (foo) (SELECT foo FROM auto_incs.intcol); |
| 92 |
INSERT INTO auto_incs.intcol (foo) (SELECT foo FROM auto_incs.intcol); |
| 93 |
INSERT INTO auto_incs.intcol (foo) (SELECT foo FROM auto_incs.intcol); |
| 94 |
INSERT INTO auto_incs.intcol (foo) (SELECT foo FROM auto_incs.intcol); |
| 95 |
INSERT INTO auto_incs.intcol (foo) (SELECT foo FROM auto_incs.intcol); |
| 96 |
INSERT INTO auto_incs.intcol (foo) (SELECT foo FROM auto_incs.intcol); |
| 97 |
INSERT INTO auto_incs.intcol (foo) (SELECT foo FROM auto_incs.intcol); |
| 98 |
INSERT INTO auto_incs.intcol (foo) (SELECT foo FROM auto_incs.intcol); |
| 99 |
CREATE TABLE auto_incs.intcolunsigned ( |
| 100 |
id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, |
| 101 |
foo INT |
| 102 |
); |
| 103 |
INSERT INTO auto_incs.intcolunsigned (foo) (SELECT foo FROM auto_incs.intcol); |
| 104 |
CREATE TABLE auto_incs.bigintcol ( |
| 105 |
id BIGINT AUTO_INCREMENT PRIMARY KEY, |
| 106 |
foo INT |
| 107 |
); |
| 108 |
INSERT INTO auto_incs.bigintcol (foo) VALUES (500); |
| 109 |
INSERT INTO auto_incs.bigintcol (foo) (SELECT foo FROM auto_incs.bigintcol); |
| 110 |
INSERT INTO auto_incs.bigintcol (foo) (SELECT foo FROM auto_incs.bigintcol); |
| 111 |
INSERT INTO auto_incs.bigintcol (foo) (SELECT foo FROM auto_incs.bigintcol); |
| 112 |
INSERT INTO auto_incs.bigintcol (foo) (SELECT foo FROM auto_incs.bigintcol); |
| 113 |
INSERT INTO auto_incs.bigintcol (foo) (SELECT foo FROM auto_incs.bigintcol); |
| 114 |
INSERT INTO auto_incs.bigintcol (foo) (SELECT foo FROM auto_incs.bigintcol); |
| 115 |
INSERT INTO auto_incs.bigintcol (foo) (SELECT foo FROM auto_incs.bigintcol); |
| 116 |
INSERT INTO auto_incs.bigintcol (foo) (SELECT foo FROM auto_incs.bigintcol); |
| 117 |
INSERT INTO auto_incs.bigintcol (foo) (SELECT foo FROM auto_incs.bigintcol); |
| 118 |
INSERT INTO auto_incs.bigintcol (foo) (SELECT foo FROM auto_incs.bigintcol); |
| 119 |
INSERT INTO auto_incs.bigintcol (foo) (SELECT foo FROM auto_incs.bigintcol); |
| 120 |
INSERT INTO auto_incs.bigintcol (foo) (SELECT foo FROM auto_incs.bigintcol); |
| 121 |
INSERT INTO auto_incs.bigintcol (foo) (SELECT foo FROM auto_incs.bigintcol); |
| 122 |
INSERT INTO auto_incs.bigintcol (foo) (SELECT foo FROM auto_incs.bigintcol); |
| 123 |
INSERT INTO auto_incs.bigintcol (foo) (SELECT foo FROM auto_incs.bigintcol); |
| 124 |
INSERT INTO auto_incs.bigintcol (foo) (SELECT foo FROM auto_incs.bigintcol); |
| 125 |
INSERT INTO auto_incs.bigintcol (foo) (SELECT foo FROM auto_incs.bigintcol); |
| 126 |
CREATE TABLE auto_incs.bigintcolunsigned ( |
| 127 |
id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY, |
| 128 |
foo INT |
| 129 |
); |
| 130 |
INSERT INTO auto_incs.bigintcolunsigned (foo) (SELECT foo FROM auto_incs.bigintcol); |
| 131 |
analyze table auto_incs.tinyintcol; |
| 132 |
Table Op Msg_type Msg_text |
| 133 |
auto_incs.tinyintcol analyze status OK |
| 134 |
analyze table auto_incs.tinyintcolunsigned; |
| 135 |
Table Op Msg_type Msg_text |
| 136 |
auto_incs.tinyintcolunsigned analyze status OK |
| 137 |
analyze table auto_incs.smallintcol; |
| 138 |
Table Op Msg_type Msg_text |
| 139 |
auto_incs.smallintcol analyze status OK |
| 140 |
analyze table auto_incs.smallintcolunsigned; |
| 141 |
Table Op Msg_type Msg_text |
| 142 |
auto_incs.smallintcolunsigned analyze status OK |
| 143 |
analyze table auto_incs.mediumintcol; |
| 144 |
Table Op Msg_type Msg_text |
| 145 |
auto_incs.mediumintcol analyze status OK |
| 146 |
analyze table auto_incs.mediumintcolunsigned; |
| 147 |
Table Op Msg_type Msg_text |
| 148 |
auto_incs.mediumintcolunsigned analyze status OK |
| 149 |
analyze table auto_incs.intcol; |
| 150 |
Table Op Msg_type Msg_text |
| 151 |
auto_incs.intcol analyze status OK |
| 152 |
analyze table auto_incs.intcolunsigned; |
| 153 |
Table Op Msg_type Msg_text |
| 154 |
auto_incs.intcolunsigned analyze status OK |
| 155 |
analyze table auto_incs.bigintcol; |
| 156 |
Table Op Msg_type Msg_text |
| 157 |
auto_incs.bigintcol analyze status OK |
| 158 |
analyze table auto_incs.bigintcolunsigned; |
| 159 |
Table Op Msg_type Msg_text |
| 160 |
auto_incs.bigintcolunsigned analyze status OK |
| 161 |
SELECT * FROM sys.schema_auto_increment_columns; |
| 162 |
table_schema table_name column_name data_type column_type is_signed is_unsigned max_value auto_increment auto_increment_ratio |
| 163 |
auto_incs tinyintcol id tinyint tinyint 1 0 127 28 0.2205 |
| 164 |
auto_incs tinyintcolunsigned id tinyint tinyint unsigned 0 1 255 32 0.1255 |
| 165 |
auto_incs smallintcol id smallint smallint 1 0 32767 4085 0.1247 |
| 166 |
auto_incs smallintcolunsigned id smallint smallint unsigned 0 1 65535 4096 0.0625 |
| 167 |
auto_incs mediumintcol id mediumint mediumint 1 0 8388607 262126 0.0312 |
| 168 |
auto_incs mediumintcolunsigned id mediumint mediumint unsigned 0 1 16777215 196606 0.0117 |
| 169 |
auto_incs intcol id int int 1 0 2147483647 262126 0.0001 |
| 170 |
auto_incs intcolunsigned id int int unsigned 0 1 4294967295 196606 0.0000 |
| 171 |
auto_incs bigintcol id bigint bigint 1 0 9223372036854775807 262126 0.0000 |
| 172 |
auto_incs bigintcolunsigned id bigint bigint unsigned 0 1 18446744073709551615 196606 0.0000 |
| 173 |
DROP DATABASE auto_incs; |