-
-
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
Speed up of saving new articles #13505
Conversation
63e9294
to
5787d92
Compare
sorry wrong pull |
@csthomas would you consider also adding the |
I will but now I want to add it to joomla 3.7. |
72733e6
to
9d7736e
Compare
2fbbaca
to
be84faa
Compare
I have added two versions of |
I have tested this item ✅ successfully on be84faa Tested on:Joomla! 3.7.0-beta1-nightly This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13505. |
@ggppdk Can I ask you for test mainly on postgreSQL (two versions). |
@csthomas, I moved to new apartment, trying to keep up with existing obligations now, little time till 10 of February, i hope someone can step up to test this |
@ggppdk Thanks for response. |
I have tested this item ✅ successfully on be84faa Before patch After patch It was successful following the Testing instruction. But when i do the following, with or without the PR :
Any ideas on this anomaly ? This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13505. |
this is ok, you add articles to featured but list order is by article ordering (not featured ordering)
You add in one time 3 articles to featured, sql will deliver 3 featured with ordering=0 to reorder. IMO It won't preserve any order. it is a set of 3 articles, not ordered list of 3 items. |
@waader @alikon @photodude Can you help with test? (mainly postgresql, but it would be nice to test mssql too) |
@csthomas I'm currently primarily working on the Windows CI testing with Appveyor So I haven't had time to test CMS specific PRs (my current local needs to be rebuilt too, especially for any PostgreSQL or MSSQL testing). If you would be willing to pitch in on those projects, I could allocate time to setup a local for testing here. There is some additional consideration with PostgreSQL or MSSQL testing, we often only merge those by code review especially when MySQL passes, or if there are no MySQL related changes. Since the change will be held up if try to find someone with a system configuration that meets those edge case requirements and time to test. Final call on a Merge by review would need to be made by the release leader or someone else with commit privileges. We have two successful tests on MySQL, so technically we just need two reviewers to mark approved and this is RTC |
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.
Looks good by code review. Includes Unit tests, so we should be good overall.
I have tested this item ✅ successfully on be84faa Before the patch After the patch COUNT : 4044 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13505. |
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/13505. |
Pull Request for Issue #10567.
Related to older implementation at #12839 which requires postgreSQL >= 8.4.2.
Summary of Changes
JTable::reorder()
method with B/C.JDatabaseQuery::selectRowNumber($orderBy, $orderColumnAlias)
which add an additional incremental column to SELECT type query.selectRowNumber
only once per query.How it works.
row_number
column.Details about
selectRowNumber()
row_number
column - you can use safely$db->loadRowList()
, examples:row_number
is always on the last column, This is related to index column atloadRow()
andloadRowList()
.Other changes
fix update query with join: PostgreSQL - return the same string each time of call __toString() on update query with join #13284- mergedadd sql var "CREATE TEMP SEQUENCE ROW_NUMBER" after establish a connection.INSERT OR REPLACE INTO
ROW_NUMBER(init=null, partitionBy=null)
after establish a connection.selectRowNumber
and multi table UPDATE query.Testing Instruction
If something went wrong then test it first without PR.
After this PR result should be the same.
[UPDATED]
How to test on postgreSQL
PostgreSQL Query has 2 versions of code which depend on postgresql server version (< 8.4 or >= 8.4).
So it would be good to test 2 options but as usual there is probably nobody with postgresql >= 8.3.18 and < 8.4.
https://github.com/joomla/joomla-cms/blob/staging/libraries/joomla/database/driver/postgresql.php#L579
from
{
to
{ return '8.3.18';
and test again.
Documentation Changes Required
Probably.
Introduce a new public method
JDatabaseQuery::selectRowNumber()
.Main database drivers (mysql, postgresql, sqlsrv and sqlite) can use Update with innerJoin.
SQLite driver has a new sqlite function
ROW_NUMBER(init=null, partitionBy=null)
.Benchmark (old)
I tested this on MariaDB 10.0.27, php 7.0.8 on my laptop.
After patch reorder is almost 100x faster for 4000 articles in one category. Total articles ~233k.