[Rt-devel] Huge number of database queries

Jeff Davis pgsql at j-davis.com
Sun Nov 18 17:10:09 EST 2007

RT seems to be generating a huge amount of database traffic. After
investigating, we found that most of the queries were because the static
content (e.g. .css files, image files, .js files) was also generating
database traffic, about 19 queries each. The total number was about 700
queries for one page load!

So, of course, we reconfigured so that static content is not handled by
RT. However, a single dynamic page (e.g. ticket view) still generates
119 queries, which still seems like a huge number to me.

Here is the breakdown for one dynamic page load (displaying a ticket):

119  queries total
  067  statements
    049  select
      005  ping test
      044  other
    016  deallocate
    002  set
  052  parse/bind/execute

Is this expected? Is there a way to bring this to a more reasonable
number? It's hard for me to imagine that we need 44 normal SELECT
statements to view a ticket. The 16 additional prepared statements,
which are then immediately DEALLOCATEd are probably excessive as well.

Keep in mind this is a page _reload_ so the page has already been loaded

	Jeff Davis

More information about the Rt-devel mailing list