Re: Mysql and memory issue
| From: | Yasuo Ohgaki | Date: | Wed, 10 Apr 2002 14:50:19 +0000 |
| Subject: | Re: Mysql and memory issue | ||
| References: | 1 2 | Groups: | php.db php.db |
| Request: | Send a blank email to php-db+get-18392@lists.php.net to get a copy of this message | ||
I really suggest you to take a look at the manual....
Try
http://www.php.net/manual/en/function.mysql-unbuffered-query.php
Mail list not suitable to explain about ulimit, mamory manager, etc.
(i.e. You may want some books for this)
Your query result is exceeding memory limit that the web server
process can allocate...
--
Yasuo Ohgaki
Trond Erling Hundal wrote:
Thanks Yasuo Ohgaki and Gurhan Ozen. My system has 256mb of DDR ram, it's a Intel PIII 900Mhz processor. Ps -aux | grep mysql shows that about all of the mysql connections uses about 15mb of memory. Is that too much? My query fetches 15 records from two tables. Here is the query: SELECT article.tittel as title,article.dato as date, article.artikkelid as id, article.picid as pic, article.ingress as ing, article.categori as cat, article.emne as sub, article.text as text FROM article, Article_ref WHERE article.dato < NOW() AND article.categori = 'nyhetsak' AND article.artikkelid = Article_ref.artikkelid AND Article_ref.portalid = $content // <--- Here's a php varfor which page we are on.ORDER BY article.dato DESC LIMIT 0,15I read that "where" statements can be very inefficient. I feel I have a lot of "where" conditions in my query. The output from the EXPLAIN select.... In the "extra" field it says: "where used; Using temporary; Using filesort" These are three drawbacks of my query?-----Original Message----- From: Yasuo Ohgaki [mailto:yasuo_ohgaki@yahoo.com] Sent: 9. april 2002 17:14 To: Trond Erling Hundal Subject: Re: Mysql and memory issue Trond Erling Hundal wrote:Hi, maybe this list isn't the best place to ask for this but...This is the right place.I keep getting "memory exhausted" errors from mysql, on a system running as mail/mysql/apache+php server. (rh7.1) Is it myqueries thatare inefficient? Is it my modelling-scheme that sucks orcould it bethat mysql is leaking memory in some way? Would it help tomove mysqlto a separate machine?If you do normal query, mysql store whole result in memory! You can avoid that. It's in the manual. -- Yasuo Ohgaki