我正在编写一个检索网页的软件,将有关它们的一些关键信息提取到一个对象中,然后将其写入 ZODB 数据库。我最终将大约 350,000 个这些对象写入我的数据库。
在我的代码运行了一段时间后,每当我向数据库添加新对象时,它就会开始发布此消息......
UserWarning: The <class 'persistent.mapping.PersistentMapping'>
object you're saving is large. (26362014 bytes.)
Perhaps you're storing media which should be stored in blobs.
Perhaps you're using a non-scalable data structure, such as a
PersistentMapping or PersistentList.
Perhaps you're storing data in objects that aren't persistent at
all. In cases like that, the data is stored in the record of the
containing persistent object.
In any case, storing records this big is probably a bad idea.
所以我的问题首先是错误消息所指的 26MB 是用于添加的单个对象还是整个数据库。这些对象中的每一个都应该很小,但是消息会显示在每个添加的新对象上。