This can certainly be done using a simple script and reading the database.
I am interested to know if the same is possible using some MySQL query.
Table Schema :
+--------+-------------------------------+
| doc_id | doc_title |
+--------+-------------------------------+
| 40692 | hello |
| 13873 | isaac |
| 37739 | einstei |
| 36042 | cricket |
| 96249 | astronaut |
| 81931 | discovery |
| 28447 | scooby |
| 99632 | popeye |
+--------+-------------------------------+
Here doc_id is a random number between 1 to 99999 , the distribution is sparse. I would want to know longest ( or all of the longest ) unused number ranges in my mysql table.
i.e. if 71000 to 83000 is the longest such range, there will be no record having doc_id lying between these two values.
How about something like this