https://dagster.io/ logo
Title
g

Gustavo Carvalho

05/22/2023, 10:08 PM
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

owen

05/22/2023, 10:33 PM
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

Gustavo Carvalho

05/22/2023, 10:37 PM
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

owen

05/22/2023, 10:47 PM
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

Gustavo Carvalho

05/22/2023, 10:49 PM
hmmm, I see, so the safest option would be to keep the
AssetMaterialization
logs in the
event_log
table
o

owen

05/22/2023, 10:49 PM
yep exactly