开发者

SQL: Multiple table.column single index

开发者 https://www.devze.com 2023-03-11 19:19 出处:网络
Is there a SQL database that allows having a single index on multiple table.column so I can query for multiple table.column at the same time and have the index return the table.column and the primary开

Is there a SQL database that allows having a single index on multiple table.column so I can query for multiple table.column at the same time and have the index return the table.column and the primary开发者_运维百科 key of the table?

Or may I always have to use an external index like Lucene?

Clarification: The index I want is across multiple tables


You can an index to a view which join tables in most RDBMS.

This allows you to have a single index on many columns across many tables

In SQL Server, this is an indexed view. Or materialized view in Oracle.


You can't have a single index applied to columns in multiple tables. With Lucene it is possible to use external indexes as you mentioned.

Check the following link for Lucene:

Using Lucene – External Indexes


Is there a SQL database that allows having a single index on multiple table.column so I can query for multiple table.column at the same time and have the index return the table.column and the primary key of the table?

Not sure I get your question, but it seems you're wondering about the potential for bitmap index scans.

If so, yes. PostgreSQL allows to do that. Best I'm aware, MySQL won't, nor will SQLite. Not sure about Oracle and SQL-Server (though I'd expect yes for both).

0

精彩评论

暂无评论...
验证码 换一张
取 消