数据库

Sql Snippets

230 words
Show MySQL processlist SHOW FULL PROCESSLIST Check Binlog show variables like 'log_bin' show tables SHOW TABLES command provides you with an option that allows you to filter the returned tables using the LIKE operator or an expression in the WHERE clause as follows: SHOW TABLES LIKE pattern; SHOW TABLES WHERE expression; > SHOW TABLES LIKE 'p%'; +------------------------------+ | Tables_in_testdb (p%) | +------------------------------+ | productlines | | products | +------------------------------+ 2

Django 数据库连接池

4270 words
数据库长连接 长连接是指程序之间的连接在建立之后,就一直打开,被后续程序重用。使用长连接的初衷是减少连接的开销。 先看看官方文档是怎么讲Djan

MySQL索引和锁

4408 words
索引失效的情况 create payment table: create table payment_tab { `id` bigint unsigned auto_increment, `payment_id` bigint unsigned not null, `user_id` bigint unsigned not null, `create_time` int unsigned not null, `update_time` int unsigned not null default 0, `amount` bigint not null default 0, `payment_status` tinyint not null default 0, `ref` varchar(64) default NULL, `payment_type` tinyint not null default 0, primary key (`id`), -- 主键 `idx_user_id` (`user_id`),