I’m on MySQL 5.7 I have a table that is about 150GB, the storage on the computer is only 200GB. So I wanted to get rid of data older than 9 months on this table. So my plan was to take a dump of the table with the where clause. Then truncate the table, and… Read More Does MYSQLDump create temp tables?
How do transactions within stored procedures affect each other? Is it possible to use this structure or will the second procedure interrupt the transaction of the first one? CREATE PROCEDURE some_procedure() begin … CALL some_procedure1(); CALL some_procedure2(); … end CREATE PROCEDURE some_procedure1() begin START TRANSACTION; … COMMIT; end CREATE PROCEDURE some_procedure2() begin START TRANSACTION; …… Read More MySQL sequential procedure call with transactions
Can I somehow combine these two queries into one in MySQL 5.7 without global variables and stored procedures? define p1_id, p2_id int; … insert into Cards_in_game_decks select * from Cards_in_decks where Cards_in_decks.player_id=p1_id order by rand() limit 10; insert into Cards_in_game_decks select * from Cards_in_decks where Cards_in_decks.player_id=p2_id order by rand() limit 10; >Solution : You just… Read More Select n random rows per group in MySQL 5.7