One more code block fix

This commit is contained in:
Ian Gulliver
2019-04-24 06:27:05 +00:00
parent a8454821f4
commit e924f0f659

View File

@@ -36,8 +36,7 @@ Then, things that cost development time, in increasing order of complexity:
1. Stop using AUTO\_INCREMENT. Instead, keep a table [IdSequences](http://www.reddit.com/r/mysql/comments/jcw8o/database_best_practices_for_future_scalability/c2b2o4v), and do something like: 1. Stop using AUTO\_INCREMENT. Instead, keep a table [IdSequences](http://www.reddit.com/r/mysql/comments/jcw8o/database_best_practices_for_future_scalability/c2b2o4v), and do something like:
``` ```BEGIN;
BEGIN;
UPDATE IdSequences SET LastId=LAST_INSERT_ID(LastId+Increment) UPDATE IdSequences SET LastId=LAST_INSERT_ID(LastId+Increment)
WHERE TableName='A' AND ColumnName='b'; WHERE TableName='A' AND ColumnName='b';
INSERT INTO A (b, c) VALUES (LAST_INSERT_ID(), foo); INSERT INTO A (b, c) VALUES (LAST_INSERT_ID(), foo);