? ? Pending

User tests: Successful: Unsuccessful:

avatar PabloMoneylesh
PabloMoneylesh
8 Apr 2020

Pull Request for Issue #28610 .

Summary of Changes

During article hit counter increment there is an additional #content table read which produces unwanted Db load and network trafic.
components/com_content/models/article.php

Changes in the method that Increments the hit counter for the article.

public function hit($pk = 0)

Before the actual update
$table->hit($pk);
It reads required row from the content table $table->load($pk);.
That selects all columns including "fulltext" which can be quite big.

That redundant select produces additional network and DB load.

Testing Instructions

Check the hit counter for an article.
Visit the article on the frontend.
Check the hit counter again.
In DB queries log should NOT be present request:
"SELECT * FROM #_content WHERE id = 'XXX'"
Where XXX is the visited article Id.

Expected result

After visit the article page hit counter should be incremented by 1.
No request performed "SELECT * FROM #_content WHERE id = 'XXX'"

Actual result

Request is performed:
"SELECT * FROM #_content WHERE id = 'XXX'"

Documentation Changes Required

No

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
4.00

avatar PabloMoneylesh PabloMoneylesh - open - 8 Apr 2020
avatar PabloMoneylesh PabloMoneylesh - change - 8 Apr 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 8 Apr 2020
Category Front End com_content
avatar PabloMoneylesh PabloMoneylesh - change - 8 Apr 2020
Title
remove redundant table read
[3.x]remove redundant table read
avatar PabloMoneylesh PabloMoneylesh - edited - 8 Apr 2020
avatar PabloMoneylesh PabloMoneylesh - change - 8 Apr 2020
The description was changed
avatar PabloMoneylesh PabloMoneylesh - edited - 8 Apr 2020
avatar PabloMoneylesh PabloMoneylesh - change - 8 Apr 2020
Title
[3.x]remove redundant table read
[3.x]remove redundant table read during Article hit counter increment
avatar PabloMoneylesh PabloMoneylesh - edited - 8 Apr 2020
avatar PabloMoneylesh PabloMoneylesh - change - 8 Apr 2020
The description was changed
avatar PabloMoneylesh PabloMoneylesh - edited - 8 Apr 2020
avatar PabloMoneylesh PabloMoneylesh - change - 8 Apr 2020
The description was changed
avatar PabloMoneylesh PabloMoneylesh - edited - 8 Apr 2020
avatar SharkyKZ
SharkyKZ - comment - 8 Apr 2020

Can you make the same change in other components as well?

avatar PabloMoneylesh
PabloMoneylesh - comment - 9 Apr 2020

@SharkyKZ Ok, I'll do it across all com_content models, and check other components if it exists also there.
Gonna create followup PR.

avatar PabloMoneylesh PabloMoneylesh - change - 11 Apr 2020
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - change - 11 Apr 2020
Category Front End com_content Front End com_contact com_content com_newsfeeds com_tags
avatar alikon
alikon - comment - 11 Apr 2020

I have tested this item successfully on 6f31773


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

avatar alikon alikon - test_item - 11 Apr 2020 - Tested successfully
avatar toivo
toivo - comment - 12 Apr 2020

I have tested this item successfully on 6f31773

tested successfully on 3.9.17 dev of 20200412


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

avatar toivo toivo - test_item - 12 Apr 2020 - Tested successfully
avatar Quy Quy - change - 12 Apr 2020
Status Pending Ready to Commit
avatar Quy
Quy - comment - 12 Apr 2020

RTC


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

avatar HLeithner HLeithner - change - 12 Apr 2020
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2020-04-12 08:44:22
Closed_By HLeithner
Labels Added: ?
avatar HLeithner HLeithner - close - 12 Apr 2020
avatar HLeithner HLeithner - merge - 12 Apr 2020
avatar HLeithner
HLeithner - comment - 12 Apr 2020

Thanks

Add a Comment

Login with GitHub to post a comment