The query below helps you to locate tables without a primary key:

Posted moss_tan_jun

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了The query below helps you to locate tables without a primary key:相关的知识,希望对你有一定的参考价值。

SELECT tables.table_schema, tables.table_name, tables.table_rows
FROM information_schema.tables
LEFT JOIN (
SELECT table_schema, table_name
FROM information_schema.statistics
GROUP BY table_schema, table_name, index_name
HAVING
SUM(
CASE WHEN non_unique = 0 AND nullable != ‘YES‘ THEN 1 ELSE 0 END
) = COUNT(*)
) puks
ON tables.table_schema = puks.table_schema AND tables.table_name = puks.table_name
WHERE puks.table_name IS NULL
AND tables.table_schema NOT IN (‘mysql‘, ‘information_schema‘, ‘performance_schema‘, ‘sys‘)
AND tables.table_type = ‘BASE TABLE‘ AND engine=‘InnoDB‘;

 

mysql> SET GLOBAL slave_rows_search_algorithms = ‘INDEX_SCAN,HASH_SCAN‘;

https://dev.mysql.com/doc/refman/5.7/en/replication-options-slave.html#option_mysqld_slave-rows-search-algorithms

以上是关于The query below helps you to locate tables without a primary key:的主要内容,如果未能解决你的问题,请参考以下文章

Computer Graphics Research Software Helping you avoid re-inventing the wheel since 2009

Packet for query is too large (> 4,194,304). You can change this value on the server

HELP!the last one for today,thanks very much.

Use the following method printPrimes() for questions a-f below

The specified Android SDK Build Tools version (29.0.0) is ignored, as it is below the minimum suppor

码云clone提示“you do not have permission to pull from the repository”