def METHOD_NAME(docs):
    """Add `data` to all docs by querying memcache/database."""
    def get(keys):
        if not keys:
            return []
        return db.query(
            "SELECT thing.id, thing.key, data.revision, data.data"
            " FROM thing, data"
            " WHERE thing.id = data.thing_id"
            " AND thing.latest_revision = data.revision"
            " AND key in $keys",
            vars=locals(),
        )
    keys = [doc.key for doc in docs]
    d = mc and mc.get_multi(keys) or {}
    debug(f"{len(d)}/{len(keys)} found in memcache")
    keys = [doc.key for doc in docs if doc.key not in d]
    for row in get(keys):
        d[row.key] = row.data
    for doc in docs:
        doc.data = json.loads(d[doc.key])
    return docs