Is there a way to quickly find doc type usage? (for both element/non-element types)

Trying to refactor a solution, I need to find all usages of a doc type.

Tried using some of the umbraco source code, like:

SqlContext.Query<IContent>().WhereIn(x => x.ContentTypeId, contentTypeIds)

but that only gives me only content tree nodes, not nested content elements.

When I refactor and rename an element type, for example, I need to know all the places where nested content of that type will die, so I can take a copy and rebuild it after.

Is there a way to fetch the nested content elements of type?


This is a companion discussion topic for the original entry at https://our.umbraco.com/forum/102785-is-there-a-way-to-quickly-find-doc-type-usage-for-both-elementnon-element-types