-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[#34066] Sql optimise category edit options branch2 #4106
[#34066] Sql optimise category edit options branch2 #4106
Conversation
…goryEdit_optionsBranch2
->join('INNER', '#__assets AS a ON c.asset_id = a.id') | ||
->where('c.extension = ' . $db->quote($component)) | ||
->where('c.published = 1'); | ||
->from('('.$subQuery->__toString().') AS c') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi, i would suggest to use here blanks bevor and after the dots like line 100: https://github.com/joomla/joomla-cms/pull/4106/files#diff-7f6a39d14455709ee20d94d487a9cc67R100
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed the spaces
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@test @nadeeshaan i can confirm the query change. ok here. Is there any special thing that can/need be tested? It still retrun the same count of rows on my end. |
@zero-24 On Wed, Aug 13, 2014 at 7:50 PM, zero-24 [email protected] wrote:
Nadeeshaan Gunasinghe |
thanks @nadeeshaan I can confirm the result by @infograf768 My results are: So full success here. 👍 |
@810 |
@nadeeshan |
@infograf768 |
@nadeeshaan Use of subquery would makes sense but think there is an error in your description (mentioning x.). Additionally, in this case the LEFT JOIN could be avoided completely imho, as b is not used at all in the query!!! @ALL Imho, those optimization tests should be conducted with large datasets and after having queried the database at least 20 times if not more, so that it has "warmed-up", not with just 3, 30 or even 300 rows, if you want to have any meaningful results, thousands or tens of thousands of rows are needed to see a significant result. |
@beat com_overload is sufficient for the task? Any links for a Joomla 3 compatible version? |
@dgt41 don't understand your question. What is com_overload ? What I said, is that even though table b is joined in "Original Query before the Optimization" above in the description, none of its columns is used. Moreover, as it is a left join, the only benefit is to have multiple repeated rows depending on if more than 1 left join is possible. So the query itself seems buggy. I guess its original intend was to compute the level by counting the joined elements, but as the (redundant) "level" column exists and is used here, the join is a leftover from the past (from when nested trees were implemented according to The Book). So not sure that the optimization makes any sense (didn't look at the PHP code as the diff shows not that easily understandable original code). |
com_overload is a component that creates mass content in joomla: http://github.com/nikosdion/com_overload |
com-overload should work fine on j3,3 - I have it running on my test site right now building over 1000 categories and 1500 articles. On 15 August 2014 22:40, dgt41 [email protected] wrote:
Brian Teeman |
👍 Brian, I already setup a new test bench, I will post some results when the script finish adding stuff |
Yeah. I've set mine running and will test tomorrow
|
@test |
By the way @beat's suggestion to remove the last left join |
@test tool used: mysqlslap old query
new query
|
Merged into the |
Testing Instructions:
In order to test this PR first apply the PR via the joomla Patch Test. Then log in to the admin panel and click on the add new article. After clicking on the add new article, the query executes.
Original Query before the Optimization
After the Optimization
Query Change Description
In the new query the change is the new sub select. In the previous query the tables are being joined and in the new query as you can see in the red color query is the sub select. In the sub select it filters the rows according to the
WHERE
clause of the previous query. As you can see this filters the rows and reduce the number of rows before the join and which results a fever number of rows to choose the attributes.Also Removed the group by clause and added theSELECT DISTINCT
insteadhttp://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=34066