- connection pooling
- server variables
- limit the result
- date time
show variables like 'max_connections'
select @@global.net_write_timeout;
select @@global.net_read_timeout;
select @@global.wait_timeout;
select @@global.connect_timeout;
## check pool size
show variables like 'max_connections'
## set in connection string
Server=server;Port=3306;Database=db;Uid=uid;Pwd=pwd;Allow User Variables=True;maximumpoolsize=200
SELECT * FROM tbl_foo WHERE name = 'sarmen' LIMIT 1
SELECT * FROM JobLinkQueue
WHERE (BrandIndex = @brandId AND Status = 1)
OR (BrandIndex = @brandId AND Status = 2 AND BookingDate < NOW() - INTERVAL 10 MINUTE)
ORDER BY Status, `Index` LIMIT 1