Jump to content

Updating rows when no content changes and topicStarterIds-ta


TSP

Recommended Posts

In background tasks and upgrade tasks you generally seem to like updating the database even though the values you'd like to update is the same. 

I can understand that this might make sense to do in some circumstances, but in cases where it's not much extra work to check if it's the same values, it could speed up the execution of background tasks and upgrade processes quite a bit. 

As an example of a background task that I saw benefit from this is: applications/forums/extensions/core/Queue/TopicStarterIds.php

In the majority of cases the initial value will be correct, so it doesn't make sense to spend time updating every row. 

 

As an added note: this task also suffers from the fact it uses offsets in the select, instead of requesting topic ids larger than X.

I saw a decrease in query time from roughly 1.5 to 0.5 seconds for the high Ids when I rewrote the select-query for this task. 

When you have 1.6 million rows, this adds up. 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...