开发者

Write an efficient query

开发者 https://www.devze.com 2023-01-15 18:09 出处:网络
Working on an in-house ticketing system in php/mysql.This short term ticketing system has been in place for a year or so now.

Working on an in-house ticketing system in php/mysql. This short term ticketing system has been in place for a year or so now.

We are reaching 10,000 tickets and I would like to make the queries more efficient, since 9,500 or so of the tickets do not need to be looked at each day.

Right now the queries are getting rows by tech开发者_JAVA百科 id, then checking to see if it's an open ticket.

I am guessing that if I make it look for open tickets then tech id the query will be more efficient. Is this true (rows with less options to rows with more options as the query builds?)


Don't guess, measure!

The most important part is that you have appropriate indexes for your query. And 10000 is not a large number of rows, if this is noticably slow your query probably isn't using an index.

SO question: What resources exist for Database performance-tuning?

0

精彩评论

暂无评论...
验证码 换一张
取 消