def getMetadataSizes(conn, showEmpty = True):
    """Get sizes of all InterMine metadata entries

    Returns a dictionary of <name>:<size>

    conn - open database connection
    showEmpty - if true then 0 sizes are also shown"""
    with conn.cursor() as cur:
        cur.execute("select key, length(value), length(blob_value) from intermine_metadata;")
        entries = cur.fetchall()
        results = {}

        for entry in entries:
            (name, size, blobSize) = entry

            size = max(size, blobSize)

            if showEmpty or size > 0:
                results[name] = size

    return results