Subject A select query seems to write to disk?!
Author diwic2
In a program that I know the source but cannot compile, one query is
executed about 2000 times, and this takes 53 seconds.

Under these 53 seconds, CPU of fbserver.exe is only about 5-10%, so I
went further studying what it could be waiting for, and found out that
fbserver seemed to be writing data to disk! This seems a bit strange
to me, as it only is a select query, not an update query. I think it's
the same transaction running all queries, but i think the query is
being prepared and unprepared 2000 times.

But the question is: In what way does this select query write data to
disk?

The select query is:

SELECT modules.path, projects.name
FROM modules, projects, pjmodule
WHERE modules.moduleid = :moduleid
AND pjmodule.moduleid = modules.moduleid
AND projects.projectid = pjmodule.projectid

And the plan is:

PLAN JOIN (MODULES INDEX (PK_MODULES),PJMODULE INDEX
(FK_PJMODULE_FK_PJMODU_MODULES),PROJECTS INDEX (PK_PROJECTS))

// David