Forum Moderators: coopster

Message Too Old, No Replies

How to analyze mySQL performance in PHP pages (memory problems)

trying to optimize my SQL queries

         

guarriman

8:36 am on Apr 4, 2007 (gmt 0)

10+ Year Member



Hi.

Working with PHP 4.4.2 and MySQL 4.1.19, I'm suffering some memory problems on my server (memory allocations, slowness), and would like to know if my mySQL queries are well-designed in terms of memory.

My website allow users to register and to share items with several degrees of privacity, so each time someone accesses webpages I must check which items are public or not, by using SQL queries. I've written code by myself so I may've done some mistakes.

Is there any way to check this mySQL performance? Some tips?

Thank you very much.

jatar_k

11:49 am on Apr 4, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



how many queries per page? What types of queries are they? (select, insert etc)

is it possible to reduce the number of queries?

is it possible to adjust the way you do privacy to embed the security in the sections/pages instead of continuously querying?

joelgreen

11:59 am on Apr 4, 2007 (gmt 0)

10+ Year Member



Is there any way to check this mySQL performance? Some tips?

Use explain statement to optimize select.
[dev.mysql.com...]

Also make sure appropriate indices added for tables.