Memory Analyzer has a built-in object query language (OQL) that allows to query the heap dump with custom SQL-like queries. Just think of classes as tables, objects as rows, and fields as columns. The basic syntax is this:
SELECT * FROM [ INSTANCEOF ] <class_name> [ WHERE <filter-expression>]