1

Topic: Optimization of heavy request

Hello!
In the table of a DB about 10 million the records, two indexes.
In a script all table gets over, $st permanently increases on 30000
Select query * FROM table1 JOIN (SELECT id FROM table1 ORDER BY id LIMIT $st, 30000) as b ON b.id = table1.id; it is very long fulfilled. Advise, please, that it is possible to make for its optimization?

2

Re: Optimization of heavy request

Portreter;
To read how it is fulfilled offset. To be terrified. Not to use offset.
Remember last met id and request the following piece from where id>?

3

Re: Optimization of heavy request

Portreter wrote:

In a script all table gets over, $st permanently increases on 30000

What for? Why not at once for one pass? Then it is not required LIMIT $st, 30000 with its overhead charge.