Forum Moderators: coopster

Message Too Old, No Replies

querying takes long time / high cpu and sometimes freezes

query cpu usage high long time

         

xuletz

9:38 am on Jan 26, 2010 (gmt 0)

10+ Year Member



Hello everyone,

I've somehow managed to make my update from this post ([webmasterworld.com ]) work, but it takes unusually long to complete the query, and my CPU usage goes sky-high for like 10 seconds, and sometimes my php is displayed blank sometimes it's properly.

I've been losing a lot of time over this :[.
Does anybody have any idea what could be causing this?

omoutop

12:40 pm on Jan 26, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



most common tips:
- use only the fields you use on your select statement. Avoid using "select * from..."
- look at your database fields and use the proper type/length for them. No point using a 'text' field to store a phone number for example.
- use indexes to speed up searching times.
- have your php executed and get your results (probably in array format) before any htm output (before any echo for example or at the very top of your page, before any meta is send to the browser)

Do these and recheck your loading times