def METHOD_NAME(event_log_storage, print_fn=None):
    from dagster._core.definitions.events import AssetKey
    from dagster._core.storage.event_log.sql_event_log import SqlEventLogStorage
    from dagster._serdes import serialize_value
    from .schema import AssetKeyTable, SqlEventLogStorageTable
    if not isinstance(event_log_storage, SqlEventLogStorage):
        return
    with event_log_storage.index_connection() as conn:
        if print_fn:
            print_fn("Querying asset keys.")
        results = conn.execute(
            db_select(
                [
                    AssetKeyTable.c.asset_key,
                    AssetKeyTable.c.asset_details,
                    AssetKeyTable.c.last_materialization,
                ]
            )
        ).fetchall()
        if print_fn:
            print_fn(f"Found {len(results)} assets to reindex.")
            results = tqdm(results)
        for row in results:
            asset_key_str, asset_details_str, last_materialization_str = row
            wipe_timestamp = None
            event = None
            asset_key = AssetKey.from_db_string(asset_key_str)
            if asset_details_str:
                asset_details = deserialize_value(asset_details_str, AssetDetails)
                wipe_timestamp = asset_details.last_wipe_timestamp if asset_details else None
            if last_materialization_str:
                event_or_materialization = deserialize_value(last_materialization_str, NamedTuple)
                if isinstance(event_or_materialization, EventLogEntry):
                    event = event_or_materialization
            if not event:
                materialization_query = (
                    db_select([SqlEventLogStorageTable.c.event])
                    .where(
                        SqlEventLogStorageTable.c.asset_key == asset_key.to_string(),
                    )
                    .order_by(SqlEventLogStorageTable.c.timestamp.desc())
                    .limit(1)
                )
                materialization_row = conn.execute(materialization_query).fetchone()
                if materialization_row:
                    event = deserialize_value(materialization_row[0], NamedTuple)
            if not event:
                # this must be a wiped asset
                conn.execute(
                    AssetKeyTable.update()
                    .values(
                        last_materialization=None,
                        last_materialization_timestamp=None,
                        wipe_timestamp=(
                            utc_datetime_from_timestamp(wipe_timestamp) if wipe_timestamp else None
                        ),
                    )
                    .where(
                        AssetKeyTable.c.asset_key == asset_key.to_string(),
                    )
                )
            else:
                conn.execute(
                    AssetKeyTable.update()
                    .values(
                        last_materialization=serialize_value(event),
                        last_materialization_timestamp=utc_datetime_from_timestamp(event.timestamp),
                        wipe_timestamp=(
                            utc_datetime_from_timestamp(wipe_timestamp) if wipe_timestamp else None
                        ),
                    )
                    .where(
                        AssetKeyTable.c.asset_key == asset_key.to_string(),
                    )
                )