MySQL limits on huge number return zero rows

limitsMySQL

I have table about 1,000,000 rows. this query work well:

SELECT * FROM `articles`
WHERE `articles`.`hash` NOT
IN (
'1z8y'
)
LIMIT 2000,10 

But this query return zero rows:

SELECT * FROM `articles`
WHERE `articles`.`hash` NOT
IN (
'1z8y'
)
LIMIT 800000,10 

What's my problem? Any configure or etc?

Best Answer

Table have 1,000,000 records but It look like Table doesn't have 800000+ records where

`articles`.`hash` NOT
IN (
'1z8y'
)

But table have 2000+ records where

`articles`.`hash` NOT
IN (
'1z8y'
)

LIMIT 800000,10 will return 10 records after 800000th records but it looks like you didn't have 800000 records which satisfy your where clause condition.

You can find no. of records which satisfy your where clause using this query

SELECT Count(*) FROM `articles`
WHERE `articles`.`hash` NOT
IN (
'1z8y'
)