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

标签 android sqlite

这在性能方面更可取,并且没有错误导致从 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/

相关文章:

android - android :inputType ="textPersonName" for EditText有什么特别之处

android - Visual Studio 2017 - Xamarin - 文件 "obj\Debug\android\bin\packaged_resources"不存在

Android:谷歌不提供芯片的API吗?

python - Django SQLite 测试异常 : Different path of execution?

java - 从两个可膨胀的 Edittext arrayList 获取值并计算值

android - 是否可以完全禁用 android 应用程序中的后退按钮?

c++ - C++ 中的 sqlite3(存储过程或带有 TABLE 及其索引的复杂 sql)

android - "SQLite Error: No Such Column "即使它是一个值

ios - SWIFT:静态方法中的协议(protocol)功能在 "self"上不可见

android - 无法从 CursorWindow 读取第 0 行、第 1 列 (Android)