Hi. Thank's for nice module. Only one question: Why on simple node without blocks, with default setup, using devel I get over 40 database requests from metatag module all time?

Comments

eme’s picture

Priority: Minor » Normal

Same question for me : 30 extra queries for a single page. This is quite incredible...

May I have this issue as "normal" at least...

marcoka’s picture

Status: Active » Closed (works as designed)

firts: it would be helpful to post the querylog.
second: this does not match the definition of a "bug", it would be a performance issue.

post more, detailed infos about that and reopen.

kalis1’s picture

Status: Closed (works as designed) » Active

This query SELECT 1 FROM metatag LIMIT 0, 1 is repeated 30 times or more on any page.

This is called from metatag_metatags_load_multiple(), because of this piece of code :

  // Also need to check if the metatag table exists since this condition could
  // fire before the table has been installed yet.
  if (!db_table_exists('metatag')) {
    return array();
  }

Would it be possible to handle the installation case in another way ?

damienmckenna’s picture

Title: Too many db requests. » Remove db_table_exists call in metatag_metatags_load_multiple
Assigned: Unassigned » damienmckenna
Issue tags: +D7 stable release blocker

I'm ok with this being marked as a bug report as it's not a terribly good way of dealing with the issue, especially on something as critical as metatag_metatags_load_multiple().

dave reid’s picture

We cannot remove the call otherwise it will still cause problems on install which is where we had to add it. We should static cache the function. Or figure out the root cause. But we can't just simply "remove" it.

damienmckenna’s picture

@DaveReid: I wasn't planning to simply remove the lines, but to do something else to both avoid the original error that required this hack and the performance penalties. This is on my list to be worked on this week.

dave reid’s picture

damienmckenna’s picture

StatusFileSize
new1.31 KB

Lets try this for size. It adds a variable during hook_enable(), which is triggered after the schema is installed.

damienmckenna’s picture

Status: Active » Needs review
damienmckenna’s picture

Category: bug » task

This isn't specifically a bug.

damienmckenna’s picture

StatusFileSize
new1.57 KB

I think this is better.

damienmckenna’s picture

Committed. FYI I also added a small watchdog() statement to record if the error happens.

damienmckenna’s picture

Status: Needs review » Fixed
damienmckenna’s picture

Status: Fixed » Closed (fixed)

Last night saw the release of 7.x-1.0-beta1, so I'm closing all these "fixed" issues in the interest of tidying up the issue queue. Thank you all for your help getting us to this point!

damienmckenna’s picture

Assigned: damienmckenna » Unassigned
Issue summary: View changes