Log in

View Full Version : Opinion on speed of my SQL queries


Mark Hewitt
05-23-2002, 08:06 AM
I have a hack in mind for my board which will allow threads posted in one forum to appear in forumdisplay in another. I already have it working on a single low traffic forum; I'd like to be able to expand it to the rest of the boards however, I'm worried that, as a feature which is used realtively infrequently it will put too much extra load on the server.

i.e. The standard SQL query for getting the list of threads is of the style

SELECT somestuff FROM thread WHERE forumid=$forumid


But my modified SQL would look like

SELECT somestuff FROM thread WHERE forumid=$forumid OR crosspostedto=$forumid


Thus the select statement is searching for two things in the database rather than one. Would this include a lot of extra load, or is the database good enough for it not to be bothered by such matters. Is there any way I can improve the efficiency?

Thanks :)

Admin
05-23-2002, 08:15 AM
If you haven't, I think it would be a good idea to add an index on the crosspostedto column.