So I have only 12 slow queries after 2 hours

Uptime:                 2 hours 25 sec

Threads: 1  Questions: 893621  Slow queries: 12  Opens: 408456  Flush tables: 1  Open tables: 2048  Queries per second avg: 123.685

But in /var/log/mysql/mysql-slow.log I have queries like that:

# Time: 070123 22:12:30
# User@Host: pun[pun] @ localhost []
# Query_time: 11  Lock_time: 0  Rows_sent: 17  Rows_examined: 1594191
use pun_klasa3h;
SELECT u.email, u.title, u.url, u.yahoo, u.location, u.use_avatar, u.aim, u.msn, u.signature, u.email_setting, u.num_posts, u.registered, u.admin_note, SUM(r.rep_plus) AS count_rep_plus, SUM(r.rep_minus) AS count_rep_minus, u.reputation_enable, p.id, p.poster AS username, p.poster_id, p.poster_ip, p.poster_email, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_user_title, o.user_id AS is_online FROM posts AS p INNER JOIN users AS u ON u.id=p.poster_id INNER JOIN groups AS g ON g.g_id=u.group_id LEFT JOIN online AS o ON (o.user_id=u.id AND o.user_id!=1 AND o.idle=0) LEFT JOIN reputation as r ON (r.user_id=u.id) WHERE p.topic_id=101 GROUP BY p.id ORDER BY p.id LIMIT 2000,25;

I'm running on my server only PunBB forums. I'm using MySQL 5.0.30.

How should I find queries which are doing full table scans. How could I log it ?

Hi,

A have checked Handler_read_rnd_next in phpmyadmin and I have very big value 90 M after 50 minut when mysql is restarted.

The number of requests to read the next row in the data file. This is high if you are doing a lot of table scans. Generally this suggests that your tables are not properly indexed or that your queries are not written to take advantage of the indexes you have.

What's is wrong ?

Sometimes I see only first post of topic roll What is wrong ?

55

(2 replies, posted in PunBB 1.2 troubleshooting)

which table ?

It's done smile

Thanks for help.

Smartys how should I use it ?

MySQL config is ready for more memory hmm

I've got very high Handler_read_rnd_next like 30M after 2 hours.

Hi,

I've got multiforum server with PunBB. From few weeks I've got problem with MySQL:

File: /var/www/pun.pl_glowna/search.php
Line: 485

PunBB reported: Unable to fetch search results

Database reported: Got error 12 from storage engine (Errno: 1030)

Failed query: SELECT t.id AS tid, t.poster, t.subject, t.last_post, t.last_post_id, t.last_poster, t.num_replies, t.closed, t.forum_id FROM topics AS t WHERE t.id IN(665,905,906,903,904,901,101,603,890) GROUP BY t.id, t.poster, t.subject, t.last_post, t.last_post_id, t.last_poster, t.num_replies, t.closed, t.forum_id ORDER BY t.last_post DESC LIMIT 0, 30

I know that error 12 means not enough physical memory, so I changed my 512 MB ram to 2 GB last days ... but problem not disappear sad

Could you help me ?

60

(66 replies, posted in General discussion)

http://www.lighttpd.net/download/

Smartys wrote:

Easiest way? Remove the second parameter from the call to $db->query and $db->num_rows will work

Can you give me example ?

elbekko ok, but I would like to know amount of forums before site is generated roll

sorry, my fault sad

I want to count forums from every category big_smile

elbekko wrote:

Err... $cat_count? tongue

$cat_count is always 1

Hi,

I try $num_cats = $db->num_rows($result); but it's always 1 sad

It's my own server with enough physical memory smile I wonder why posts.MYI is always corrupted. Maybe it is happens because I have in post table message TEXT NOT NULL DEFAULT roll

This is my MySQL log

061025 13:33:05 [ERROR] /usr/libexec/mysqld: Table './pun_l2/posts' is marked as crashed and last (automatic?) repair failed
061025 16:20:20 [ERROR] /usr/libexec/mysqld: Table './pun_l2/posts' is marked as crashed and last (automatic?) repair failed
061025 16:20:20 [ERROR] /usr/libexec/mysqld: Table './pun_l2/posts' is marked as crashed and last (automatic?) repair failed
061025 20:10:08 [ERROR] Got error 12 when reading table './pun_seductionpoland/posts'
061025 20:10:17 [ERROR] Got error 12 when reading table './pun_seductionpoland/posts'
061025 20:11:57 [ERROR] Got error 12 when reading table './pun_seductionpoland/posts'
061025 20:46:51 [ERROR] /usr/libexec/mysqld: Got error 12 from storage engine
061025 20:46:51 [ERROR] /usr/libexec/mysqld: Sort aborted
061025 20:52:06 [ERROR] Got error 12 when reading table './pun_seductionpoland/posts'
061025 21:15:25 [ERROR] Got error 12 when reading table './pun_mrr/posts'
061025 22:00:31 [ERROR] Got error 12 when reading table './pun_seductionpoland/posts'
061025 22:00:57 [ERROR] Got error 12 when reading table './pun_seductionpoland/posts'

Hi,

I have got a multi forum server. One week ago I change server to the new one. I change also MySQL form 4.xx to 5.0.24a and php4 to php5. From this days I have got problem with data base. Few times a day I have got corrupt table posts.MYI in few forumus. Always corrupted is posts.MYI roll Why ?

Have you any ideas what is going on ?

Error: Unable to fetch demo title. roll

Sorry Smartys it works! Thx.

I can't because poster_id=1 is not attribute to guess but another user.

In posts table you can find only:

id, poster, poster_id, poster_ip, poster_email, message, hide_smilies, posted, edited, edited_by ,topic_id

So I can't change user_id to 1.

But I don't have this users in users in database sad

You have right. In this topic is 51 posts. 51 posts / 10 post on every page = 6 pages. But only 47 post are visible. I checked database and I find that 4 users ale lost. They were written in this topic but I don't now how they been lost (maybe delete ?). So 51-4=47 posts which are visible.

What can I do now ? How fix this ?

EDIT: I hear that they use plugin User management - v1.3 to delete all users < 10 posts. Maybe this plugin is wrong roll

I thing that I have to delete all death posts and repair num_replies in topics. But it isn't a easy way sad

Yes, both are 52. What I should do now ?