Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed performance regression introduced MySQL 8.0 #37465

Merged
merged 1 commit into from Oct 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions activerecord/CHANGELOG.md
@@ -1,3 +1,7 @@
* Fixed the performance regression for `primary_keys` introduced MySQL 8.0.

*Hiroyuki Ishii*

* Add support for `belongs_to` to `has_many` inversing.

*Gannon McGibbon*
Expand Down
Expand Up @@ -433,11 +433,11 @@ def primary_keys(table_name) # :nodoc:

query_values(<<~SQL, "SCHEMA")
SELECT column_name
FROM information_schema.key_column_usage
WHERE constraint_name = 'PRIMARY'
FROM information_schema.statistics
WHERE index_name = 'PRIMARY'
AND table_schema = #{scope[:schema]}
AND table_name = #{scope[:name]}
ORDER BY ordinal_position
ORDER BY seq_in_index
SQL
end

Expand Down