Could you explain what you mean by "relevant data"? Maybe give an example of what you're trying to do? You might want to look into full-text searches in MySQL.
You should do as much processing and searching within MySQL as possible, because it is much quicker than selecting everything and searching in PHP. Use PHP to build queries that are as specific as possible, and let MySQL do the magic searching, grouping and sorting.