views:

16

answers:

0

I'm trying to generate rating place table using following receipt

http://stackoverflow.com/questions/1776821/assign-places-in-the-rating-mysql-php

but my database is high loaded.

I tried not to create table, but use MEMORY TABLE and update it using following SQL query

insert into tops (uid) select uid from users order by exp desc;

but got the following MySQL error

Deadlock found when trying to get lock; try restarting transaction

because there are too many queries until SQL select is being executed.

How to solve this problem?

P.S. CREATE TABLE tops as SELECT work almost fine except high server load... up to load average: 50 if tops are non-memory table.

My table users has near 4.5 millions of rows.

Thanks for any advices.