This project is archived and is in readonly mode.
Refactor build_arel
Reported by Emilio Tagua | June 14th, 2010 @ 05:42 PM | in 3.0.2
The following patch is a build_arel refactoring which includes some performance improvement:
https://gist.github.com/171408/a13d6c5a9eafc87b2e6b5eac7cce940b9339...
Comments and changes to this ticket
-
Emilio Tagua June 14th, 2010 @ 06:44 PM
- no changes were found...
-
Emilio Tagua June 14th, 2010 @ 06:46 PM
- no changes were found...
-
José Valim June 16th, 2010 @ 05:39 PM
- Milestone cleared.
- Assigned user set to José Valim
-
Neeraj Singh June 16th, 2010 @ 05:53 PM
The last change in the attached patch is
- arel = @from_value.present? ? arel.from(@from_value) : arel.from(@klass.quoted_table_name) + arel = arel.from(@from_value) if @from_value.present?
I have not analyzed the code fully but based on cursory look, it seems to me that a call to arel.from(@klass.quoted_table_name) is missing in else condition.
-
Emilio Tagua June 16th, 2010 @ 06:53 PM
No, there's no need to do that, that's why i didn't include it.
It's just creating another new relation that will end up creating the same.
If there's an edge case that i'm missing please let me know, all tests are passing with the patch, so if there's any issue that is introduced with this patch please let me know so i can change it and add proper tests.
-
Repository June 19th, 2010 @ 11:59 PM
- State changed from new to resolved
(from [e061212e86ef0342fad1211fd980fc4b2195fe69]) Refactor build_arel: move joins out and simplify havings. [#4860 state:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/e061212e86ef0342fad1211fd980fc... -
José Valim June 20th, 2010 @ 12:00 AM
- State changed from resolved to open
Emilio, my git version was complaining that the second patch format was not valid. Could you please attach a new one? Links to commits in your fork is also ok. :)
-
Emilio Tagua June 20th, 2010 @ 07:55 PM
José,
I applied build_arel_2.diff in a fresh master, I don't know why you couldn't.
I attach a new patch with same changes, hope this time works for you.
Thanks!
-
Repository June 21st, 2010 @ 12:11 AM
- State changed from open to resolved
(from [7b7cedcb8d53110492e7d51405986f3e8e899fa4]) Don't waste time building relations if there are no values presents. [#4860 state:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/7b7cedcb8d53110492e7d51405986f... -
Jeremy Kemper October 15th, 2010 @ 11:01 PM
- Milestone set to 3.0.2
- Importance changed from to Low
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Tags
Referenced by
- 4860 Refactor build_arel (from [e061212e86ef0342fad1211fd980fc4b2195fe69]) Refacto...
- 4860 Refactor build_arel (from [7b7cedcb8d53110492e7d51405986f3e8e899fa4]) Don't w...