Grep is generally limited to identifying lines by matching on regular expressions. If the collection of files which grep operates on becomes large, then continual passes over the entire text on each query becomes expensive. However, its usage is simple as no auxiliary files must be created. A database consists of some data and indexes into that data. By having indexes one can query a large database quickly.
Standard databases divide the data up into records of fields.
This means that the granularity of search is a field. Using this method, we can except free-form information and yet be fast on searches. The next question is what is the overhead of this database. In MG most files which are produced are in a compressed form. By compressing the files it is possible to have the size of the database smaller than the size of the source data.