mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
859fba7c4b
MySQL supports DELETE with LIMIT and ORDER BY. https://dev.mysql.com/doc/refman/8.0/en/delete.html Before: ``` Post Destroy (1.0ms) DELETE FROM `posts` WHERE `posts`.`id` IN (SELECT `id` FROM (SELECT `posts`.`id` FROM `posts` WHERE `posts`.`author_id` = ? ORDER BY `posts`.`id` ASC LIMIT ?) __active_record_temp) [["author_id", 1], ["LIMIT", 1]] ``` After: ``` Post Destroy (0.4ms) DELETE FROM `posts` WHERE `posts`.`author_id` = ? ORDER BY `posts`.`id` ASC LIMIT ? [["author_id", 1], ["LIMIT", 1]] ``` |
||
---|---|---|
.. | ||
attributes | ||
collectors | ||
compatibility | ||
nodes | ||
visitors | ||
alias_predication.rb | ||
attributes.rb | ||
crud.rb | ||
delete_manager.rb | ||
errors.rb | ||
expressions.rb | ||
factory_methods.rb | ||
insert_manager.rb | ||
math.rb | ||
nodes.rb | ||
order_predications.rb | ||
predications.rb | ||
select_manager.rb | ||
table.rb | ||
tree_manager.rb | ||
update_manager.rb | ||
visitors.rb | ||
window_predications.rb |