my application get books and insert each word of this books to database, it may have more than 100 million words in books and inserted to database. Now I want get specific word with previous and next words. time to get result is very important.
for example : "The book words insert here in this table..."
------------------------------
|      ID      |    word     |
------------------------------
|       1      |     the     |
|       2      |     book    |
|       3      |     words   |
|       4      |     insert  |
|       5      |     here    |
|       6      |     in      |
|       7      |     this    |
|       8      |     table   |
|       .      |     .       |
|       .      |     .       |
|       .      |     .       |
------------------------------
or in other example:
------------------------------
|      ID      |    word     |
------------------------------
|       1      |     my      |
|       2      |     name    |
|       3      |     is      |
|       4      |     joseph  |
|       5      |     and     |
|       6      |     my      |
|       7      |     father  |
|       8      |    name     |
|       9      |     is      |
|       10     |    brian    |
------------------------------
I want to get previous and next value of same word
For example I want get previous and next word of "name":
--------------------------
|   my    |  name  |  is |
--------------------------
|  father |  name  |  is |
--------------------------
in other related post friends write codes but this code take long time to get result, I want get the result table quickly:
related post: [question] Get previous and next row from rows selected with (WHERE) conditions
 
     
    
