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

Saving a new article into a category with thousands of articles that are mostly archived #15158

Closed
GCLW opened this issue Apr 7, 2017 · 17 comments

Comments

@GCLW
Copy link

GCLW commented Apr 7, 2017

Steps to reproduce the issue

Created a new article and selected a category that contains around 20K articles, around 15K are given the status of "Archived". The save process takes a full minute.

Expected result

The ordering field in the content database table should have only updated those articles that are in that category and have the status as "published"

Actual result

Every article in that category had its ordering field updated +1 regardless of its status. That means ALL 20K records were updated when I added a single article. I even viewed the ordering field of one of the "Archived" articles before and after I added the new article, and indeed it was updated.

System information (as much as possible)

Joomla 3.6.4

Additional comments

I feel that at the very least "Archived" articles should not be included and updated when updating the ordering field.

@brianteeman
Copy link
Contributor

Can I ask why you are archiving those articles?

@GCLW
Copy link
Author

GCLW commented Apr 7, 2017 via email

@brianteeman
Copy link
Contributor

I am trying to see why you are not deleting them

@GCLW
Copy link
Author

GCLW commented Apr 7, 2017 via email

@brianteeman
Copy link
Contributor

Your not wasting time at all. We are currently discussing and evaluating how people are using archive so it would be useful to know why you are using archive. Even if that means you have decided you should be deleting them that is useful to know as that means we have an issue explaining the purpose of archive

@GCLW
Copy link
Author

GCLW commented Apr 7, 2017 via email

@brianteeman
Copy link
Contributor

brianteeman commented Apr 7, 2017 via email

@ghost
Copy link

ghost commented Apr 8, 2017

@brianteeman there you need a auto-archive Function (move Article after 2 Weeks from "Sport" to "Sport-Archive").

@brianteeman
Copy link
Contributor

@franz-wohlkoenig there are (or were last time I checked) plugins available for that

@ghost
Copy link

ghost commented Apr 8, 2017

@brianteeman you're right, i thought about Function in Core.

@csthomas
Copy link
Contributor

csthomas commented Apr 9, 2017

Joomla 3.7 has an improvement of reordering articles, take a look at #13505

It still reorder all such articles in category but do it in one query instead above mentioned 20K:)

@ghost
Copy link

ghost commented Apr 9, 2017

@GCLW can you test 3.7 about information of @csthomas?

@GCLW
Copy link
Author

GCLW commented Apr 10, 2017

A question of mine I have been asking is why, when a new article gets created does every article in that category need to have its ordering field updated by +1? Is it because someone felt the need to give the newly created article the ordering number of 1? If it is, I can only guess due to a complaint stating they had to drag a newly added article to the top when they view a category by the ordering field. I am sorry but the system is crippled because of that. New Articles should be given the largest number and the remaining articles should be left untouched. Think of it like a database field that is auto increment.

Something else that is not mentioned:
Prior to the 20 thousand updates there is a select statement that returns 20 thousand records that get whiled into an array of article_id => ordering elements (which that in itself is a load) That array then is used in a foreach statement that executes 20 thousand update statements.

I wish I had more time, but the project is on a deadline that is near. I wish I had more time see how this gets resolved.

@csthomas
Copy link
Contributor

A question of mine I have been asking is why, when a new article gets created does every article in that category need to have its ordering field updated by +1?

In J3.x due to B/C.

@Quy
Copy link
Contributor

Quy commented Jan 1, 2018

@franz-wohlkoenig This probably can be closed.

@joomla-cms-bot
Copy link

Set to "closed" on behalf of @franz-wohlkoenig by The JTracker Application at issues.joomla.org/joomla-cms/15158

@ghost
Copy link

ghost commented Jan 1, 2018

closed as stated above.

Thanks for hint @Quy.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/15158.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants