-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
JTable->reorder is extremely slow #8563
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
Conversation
All credits for the patch should go to Michal Michaláč, who seems to be the author of the original patch.
|
I don't know how to test it. Couldn't find any test instructions in other issues. |
libraries/joomla/table/table.php
Outdated
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.
Why is this allowed for only the deprecated JDatabaseDriverMysql object? There are additional MySQL object types which do not match this conditional.
|
Will fix the formatting issues tonight. |
|
Fixed the formatting issues, hopefully; and added PDO MySQL support. |
|
if I successfully climbed the current, like a salmon, the performance problem arise when you create a new featured article in a category with more than 100 featured articles, more featured items you have on that category more performance degradation you'll experience. |
|
Agree with @alikon that there are two sides to the coin. The original author Michal Michaláč of this patch already mentions that in https://developer.joomla.org/joomlacode-archive/issue-32329.html, so he agrees! Unfortunately the quality of the patch provided is not such that it can be incorporated into core. Don't mind as much the fact that it only works for MySQL, do mind that the MySQL specific code is proposed at the wrong spot. The patch needs rewriting to only use the more efficient method. The side benefit of that rewrite will be that it remains database agnostic. |
Since Joomla doesn't publish a list of required database permissions, I'd be weary about relying on it. There is one old update query that had to be rewritten to avoid using temporary tables because of a lack of permission in some environments. |
|
Can only hope that today the DBA will be fired instead of getting away with poor permission management! Sounds to me the same as not giving write access for the filesystem to the webserver. Take your loss and change provider, there is no medicine against bad infrastructure management. |
|
Updated title to meaningful title and copied description from original issue This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/8563. |
|
OK, someone with a large data set, better working knowledge of database engines than me, and access to environments running different engines, validate my thinking here. Instead of defining a user variable then running the update query using that, why can't it be a more simple |
|
Unfortunately, that is not doing the same thing. It just increments each rows ordering. So: |
|
Considering there's no enforcement of either unique or sequential ordering values, there's a part of me that doesn't see that as an issue. IMO it'd definitely be preferred to keep them unique and sequential within a group, but I don't see it as a hard requirement. SQL Server supports user variables, PostgreSQL doesn't (you basically need functions there). https://gist.github.com/mbabker/4074f55253c413e43af835551e30ab8d has a version of this with the Microsoft engine support. |
|
I know that is not a solution but I want to show a different idea: Benefit: |
|
@mbabker Doubt very much whether the need for reorder is even considered. Seems like it is considered obligatory. Think that they are two separate issues:
|
Some idea
From:
To:
Above I could make a few language mistakes. |
|
I don't know, the longer I look at this the more obvious it becomes -- at least to me -- that perhaps the ordering should be inverted, so that the higher the All the problems in this comment thread stem from the fact that it's the opposite in Joomla. Perhaps it's time to fix that? |
|
Hello @rysiekpl, The last comment here was on 11 Jun 2016. So the question is, Is this issue/pull request still valid? Thanks for understanding! Personally, I agree that ordering should be reversed to save everyone this "headache". This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/8563. |
|
This issue is indeed still valid. We have just upgraded to Joomla 3.6.4 and still experience the slowness. Applying the patch fixes it. It's amazing to me that this known bug with a known and production-tested fix has not been fixed yet in mainline. |
|
I still advocate that as long as Joomla claims multi database support a IIRC there is another patch proposed that tries to fix this in an agnostic On Monday, November 7, 2016, rysiekpl [email protected] wrote:
|
|
yeah i think there is one from @ggppdk |
|
@mbabker and I will reiterate that this is a BS argument, since it will not make other database servers users lives harder, but it will make 98% of Joomla's users lives much easier. Otherwise, I don't really care. We're migrating off of Joomla in the long run anyway, and this bug is one of the reasons. |
|
here it is #11184 |
|
Well, reverse the argument. If someone proposed to fix this performance issue for only PostgreSQL or SQL Server, would it be as acceptable as allowing a MySQL specific fix? I don't have an issue at all with this patch except for the fact it applies to only one of several supported platforms. If Joomla would've stayed MySQL only I would've merged this last year but alas a decision was made to claim additional support and I don't think it is fair to code performance benefits into our platform for only MySQL. |
Yes, absolutely. It doesn't make my (MySQL user) life any harder, and it makes some users lives easier. It improves the software overall without degrading my experience even a tiny bit. The other possibility is that a bug that has been found and fixed years ago is still biting users in their different bodyparts because the idea is that the experience should be exactly as shitty for everyone. Which is where Joomla is now. |
|
Take a look at PR #12839 |
|
IMHO we can close this PR. |
|
close this PR @Bakual? |
All credits for the patch should go to Michal Michaláč, who seems to be the author of the original patch.
---copied from #8189----
This is an old issue that has never been properly solved. The original issue has been closed due to lack of testing.
Website I am running started having this issue, and we have verified that:
3.4.5),We are using this patch in production on a high-traffic website. All credits for the patch should go to Michal Michaláč, who seems to be the author of the original patch.
GitHub does not allow me to attach a patch, so here it is, pasted: