My host has shut down my shared hosting account because of excessive load on the server. The following queries are blamed - but have been running for 18 months without previous incident. I set out what they sent me - the stats around the queries don't mean much to me.
Is there something I can do to improve matters? There is no indexing on the tables but is that the issue or are these queries inherently inefficient in which case how can they be improved?
Or has the host got something wrong - after all has worked for 18 months and 3 tables have no more than approx 6000 entries (images) 600 (submissions) 200 (photogs)
QUERY 1 - locates a single image and retrieves related info from 3 tables
# Time: 070718 13:33:47
# User@Host: photoconnectimag[photoconn
ectimag] @ localhost [] # Query_time: 54 Lock_time: 0 Rows_sent: 5934
Rows_examined: 5934
use photoconnectimag;
SELECT photoconnectSubmissions.su
bmitRef,
photoconnectSubmissions.lo
ginName,
photoconnectImages.imageRe
f, photoconnectImages.loginNa
me, photoconnectImages.submitR
ef, photoconnectImages.imgfile
Name, photoconnectImages.imageDe
sc1, photoconnectImages.imageDe
sc2, photoconnectImages.modelRe
lease, photoconnectImages.propRel
ease, photoconnectImages.maxSize
, photoconnectImages.sellLic
ense, photoconnectImages.sellRF,
photoconnectImages.sellFA,
photoconnectImages.buyerDe
cides, photoconnectImages.sellRes
trict, photoconnectImages.refAlam
y, photoconnectImages.pageTyp
e,
photoconnectImages.urlAlam
y, PhotoconnectPhotogs.loginN
ame, PhotoconnectPhotogs.agency
Name, PhotoconnectPhotogs.payPag
eURL, PhotoconnectPhotogs.eMail,
PhotoconnectPhotogs.websit
eURL, PhotoconnectPhotogs.firstN
ame, PhotoconnectPhotogs.lastNa
me FROM photoconnectImages, photoconnectSubmissions, photoconnectusers, PhotoconnectPhotogs WHERE imageRef = 1003567 AND photoconnectImages.submitR
ef = photoconnectSubmissions.su
bmitRef AND photoconnectImages.loginNa
me = PhotoconnectPhotogs.loginN
ame;
QUERY 2 - searches 2 tables for a keyword
# Time: 070718 13:34:13
# User@Host: photoconnectimag[photoconn
ectimag] @ localhost [] # Query_time: 121 Lock_time: 0 Rows_sent: 16
Rows_examined: 11822
use photoconnectimag;
SELECT photoconnectImages.submitR
ef, photoconnectImages.imageRe
f, photoconnectSubmissions.su
bmitRef,
photoconnectSubmissions.Va
lid,
photoconnectImages.imgfile
Name,
photoconnectImages.imageDe
sc1,
photoconnectImages.imageDe
sc2,
photoconnectImages.modelRe
lease, photoconnectImages.sellLic
ense, photoconnectImages.sellRF,
photoconnectImages.sellFA,
photoconnectImages.urlAlam
y,
photoconnectImages.refAlam
y,
photoconnectSubmissions.pa
geTitle FROM photoconnectImages
LEFT JOIN photoconnectSubmissions ON photoconnectImages.submitR
ef = photoconnectSubmissions.su
bmitRef WHERE photoconnectSubmissions.Va
lid = 'yes' AND ((imageDesc1 LIKE
'%teenager%') OR (imageDesc2 LIKE '%teenager%') OR
(pageTitle LIKE '%teenager%')) AND (Valid = 'yes') ORDER BY photoconnectImages.imageRe
f DESC LIMIT 32, 16;
Thanks
Scott