Hi all! Where are asset partitions stored in dagst...
# ask-community
g
Hi all! Where are asset partitions stored in dagster DB? we are setting up some cleanup code to avoid having the db growing too large, but we need to make sure that we are not messing up the materialization logs.
o
hi @Gustavo Carvalho! the information about partitioned asset materializations exist in the
asset_keys
table (there's a serialized object representing the sets of partitions that have are materialized, failed, etc.), and the regular event_logs table (just the AssetMaterialization events)
g
hi @owen ! Just to make sure, is it safe to delete the logs from the materialization run by deleting data from
event_logs
? All the events and also user emitted logs (e.g. through
<http://context.log.info|context.log.info>
) will be deleted, but the materialization records of the partitions will be kept in the serialized object. Is that right?
o
ah sorry I should have been more specific -- different functions use either of those two sources to determine the state they're interested in, so you would want to keep both around. the serialized object just contains a binary was/wasn't materialized bit of information, so views that render specific timestamps and such would be broken if those materialization events were deleted
g
hmmm, I see, so the safest option would be to keep the
AssetMaterialization
logs in the
event_log
table
o
yep exactly