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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ChaseOnTheWeb created an issue. See original summary.

ChaseOnTheWeb’s picture

The patch

Chris Matthews’s picture

Status: Needs review » Reviewed & tested by the community

The 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.

alex_optim’s picture

Good for me too.

voleger’s picture

Looks good

pifagor’s picture

  • pifagor committed ff97157 on 7.x-1.x authored by ChaseOnTheWeb
    Issue #2860844 by ChaseOnTheWeb, Chris2, alex_optim, voleger, pifagor:...

  • pifagor committed e5526fa on 7.x-2.x
    Issue #2860844 by ChaseOnTheWeb, Chris2, alex_optim, voleger, pifagor:...
pifagor’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.