Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
redirect_fetch_rids_by_path()
checks that the 'status' column exists in the 'redirect' table before attempting to query on it. The Drupal function db_field_exists()
queries the table every time it is called. If redirect_fetch_rids_by_path()
is called several times per page (as seems to be the case when a node has several redirects to it), this leads to several unnecessary database queries. It should be safe to make checking for the column a static, as the field will either exist or not exist in a given page request.
Comment | File | Size | Author |
---|---|---|---|
#2 | static-field-exists-2860844-2.patch | 1019 bytes | ChaseOnTheWeb |
Comments
Comment #2
ChaseOnTheWebThe patch
Comment #3
Chris Matthews CreditAttribution: Chris Matthews commentedThe patch from 2 years ago still applied cleanly to the latest 7.x-1.x-dev and seems like a reasonable fix in order to prevent any unnecessary database queries so changing the status to RBTC.
Comment #4
alex_optimGood for me too.
Comment #5
volegerLooks good
Comment #6
pifagorComment #9
pifagor