php - Little mysql_queries takes too much time -


I have very small SQL queries that take a lot of time to run. {$ Ss_a = mysql_fetch_array ("mysql_query (" Choose from genres WHERE ID "=". $ USER ["style"])); if ($ ss_a) {$ So it takes 0.7605552 "Styles from SELECT uri FROM id = 1"

and the other style code ss_uri = $ ss_a ["Yuri"];}}

/ P>

  if (! $ Ss_uri) {($ r = mysql_query ("Select from styles where id = 1")) or die (mysql_error ());  

There are other minor things that take a lot of time.

0.5507469 With problems as SELECT COUNT (ID), the problem disappears from the Helpdesk = 'No'

code: < / P> $ res = mysql_query (" Problem with helpdesk as select number (id) where solution = 'no'); $ Arr = mysql_fetch_assoc ($ res); $ Problems = $ arr ['problems'];

Is there a way to optimize these or something?

Indexing can help I can try:

  on style Index idx_styles_id_uri Create (ID, Yuri) indexx help on helpdesk idx_helpdesk_solved_id (Hull, ID)  

Comments