形成维基百科:http://en.wikipedia.org/wiki/Index_(database)
Some databases extend the power of indexing by allowing indexes to be created on functions or expressions. For example, an index could be created on upper(last_name), which would only store the upper case versions of the last_name field in the index. Another option sometimes supported is the use of "filtered" indexes, where index entries are created only for those records that satisfy some conditional expression. A further aspect of flexibility is to permit indexing on user-defined functions, as well as expressions formed from an assortment of built-in functions.
那些支持灵活索引的数据库是什么:
- 在计算列上,如:(col1 + col2) * 100
- 过滤索引。
- 为用户定义的函数建立索引。
这个功能的已知术语是什么?
最佳答案
在 oracle 中,它们被称为基于函数的索引。
对于过滤,您可能会很棘手,并创建一个函数,如果过滤器匹配则返回值,如果不匹配则返回 null。空值不存储在 btree 索引中,因此索引基本上被过滤了。您只需确保在查询中使用相同的函数即可。
我相信在 sql server 中你可以创建一个计算列和索引。
关于具有灵活索引的数据库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3596432/