具有灵活索引的数据库?

标签 database indexing database-indexes

形成维基百科: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/

相关文章:

c# - C#中恢复数据库的问题

mysql - 在sql中存储多对多分层数据的最佳方式

普通列和全文列的MySQL索引

sql-server - 当索引依赖于该列而不重新创建索引时,如何将列从 null 更改为 not null?

asp.net-mvc - ASP.NET中MVC应用程序的结构应该是什么?

ruby-on-rails - Ruby on Rails 的对象数据库

xpath - 如何通过xpath获取元素的索引?

mysql - 在什么列上建立索引并快速进行表搜索

R:具有重复时间索引条目的时间序列

mysql - 为什么 MySQL 使用索引交集而不是组合索引?