gpt4 book ai didi

android - 删除所有查询或删除查询

转载 作者:太空狗 更新时间:2023-10-29 12:55:16 25 4
gpt4 key购买 nike

这在性能方面更可取,并且没有错误导致从 android 中的 sqlite 表中删除所有行。

删除查询或删除表并重新生成表

我从这个 post 找到了这个

it is more efficient to drop table and re-create it; and yes, You can use "IF EXISTS" in this case

DELETE FROM will cause SQLite to visit individual rows unless those rows have triggers, so it's generally reasonably efficient.


edited after 1 answer post

As the Droping the table using drop table query then internally delete query was used? As in one answer post

最佳答案

根据 sqlite 查询,我找到了答案。在 sqlite 中,他们使用了截断优化,因此当省略“where”子句时,他们删除表并重新创建表,这比删除所有行要快得多。

这是链接

http://www.sqlite.org/lang_delete.html

http://www.sqlite.org/compile.html#omit_truncate_optimization

关于android - 删除所有查询或删除查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7401609/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com