Sequelize 支持 paranoid tables 的概念.
A paranoid table is one that, when told to delete a record, it will not truly delete it. Instead, a special column called deletedAt will have its value set to the timestamp of that deletion request.
Every query performed by Sequelize will automatically ignore soft-deleted records (except raw queries, of course).
考虑到隐式的 where 子句,这是否会减慢 findAll
查询的速度?
最佳答案
它与使用日期时间列和 >=
运算符的任何其他类似 WHERE 条件一样产生影响。这取决于你有多少条记录、列数据选择性、列上是否有索引或者你是否有任何其他条件、联接等。
您应该为特定查询构建 SQL 查询计划,并查看其与日期时间条件相对应的部分。
关于mysql - Sequelize paranoid true 会影响查询性能吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62202756/