Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
嗨 Wordpress 开发人员,
我正在为客户编写一个工作提供插件,我问自己在 mysql 数据库中为工作(id、标题、小时、描述、欧元、城市)创建一个额外的表或将它们保存到 wp_options 是否更有效(多个数组)。如果大数组中有 100 个作业,wp_options 的速度有多快?
最好的问候,克里斯
如果将它们作为一个大数组存储在 wp_options 中,它会很快,因为整个数组将被序列化/反序列化为 JSON 并存储为一条记录。但是,IMO,如果出现问题,很难排除故障。此外,以后很难修改模式(即,您必须编写一个特殊的脚本来将数据从旧模式迁移到新模式)。我建议您创建一个额外的表。