考虑这个关于索引甲骨文的文档,这是速度插入和这个 StackOverflow上的问题使我得出结论:
但是,每次讨论索引时,仅SELECT显示操作作为示例.
我的问题是:是否使用了索引INSERT和UPDATE操作?何时以及如何?
我的建议是:
UPDATE可以使用index in WHERE子句(如果子句中的列有索引)INSERT使用时可以使用索引SELECT(但在这种情况下,索引来自另一个表)但我对使用索引知之甚少.
Insert语句对索引没有直接的好处。但more index on a table cause slower insert operation。考虑一个没有索引的表,如果您想在其上添加一行,它将找到有足够可用空间的表块并存储该行。但是,如果该表上有索引,数据库必须确保这些新行也通过索引找到,因此要在有索引的表上添加新行,也需要在索引中条目。这会增加插入操作的数量。So more index you have, more time you need to insert new rows。
为了update it depends on whether you update indexed column or not。如果您不更新索引列,则性能不应受到影响。Index can also speed up a update statements if the where conditions can make use of indexes。