[development] Database queries on drupal.org

Peter Wolanin pwolanin at gmail.com
Fri Jul 28 16:50:22 UTC 2006


-----
>Date: Fri, 28 Jul 2006 10:49:07 -0500 (CDT)
>From: "Larry Garfield" <larry at garfieldtech.com>
>Subject: Re: [development] Database queries on drupal.org


>- Someone needs to get that query out of the forum module's theme >code. :-)

In reponse to the above, I was rather astounded to see these SQL
queries in the theme function a while back when I was figuring out
how to theme the forum pages.

I opened an issue, but haven't had any any input.  Maybe it needs a
better title?  Please follow-up there if you're interested.

http://drupal.org/node/70578

Right now there is a lot of work done every time a forum page is
viewed to generate the links to the previous and next forums.

As a start, I'd like to suggest moving to a system more like the book
module.  The forum table should get two more entries, for the node.nid
values for the previous and next node, and I'd add these into the
$node object in forum_load().

This would make it easy to generate links to next/prev links without
the titles, but getting the titles would still require a query (unless
the titles are also duplicated in the forum table).

The real trick is to figure out how and how often to update these
values.  Some schemes order the forum topics by the number of
comments.


More information about the development mailing list