将Oracle索引迁移到HP Vertica projections
我不太擅长Vertica。请帮助我大致了解如何在HP Vertica中找到在每个特定情况下反映Oracle索引的最接近的等效投影。 如果提供,我在Oracle中有下表将Oracle索引迁移到HP Vertica projections,oracle,database-migration,projection,vertica,database-indexes,Oracle,Database Migration,Projection,Vertica,Database Indexes,我不太擅长Vertica。请帮助我大致了解如何在HP Vertica中找到在每个特定情况下反映Oracle索引的最接近的等效投影。 如果提供,我在Oracle中有下表 create table new_customers(CustomerId number(10,0), Name varchar2(50), Age number(3,0), State char(2), Address varchar2(50), DateOfBirth date); 以及以下指标: create unique
create table new_customers(CustomerId number(10,0), Name varchar2(50), Age number(3,0), State char(2), Address varchar2(50), DateOfBirth date);
以及以下指标:
create unique index new_customers_idx1 on new_customers(CustomerId);
create index new_customers_idx3 on new_customers(name,age desc);
create index new_customers_idx4 on new_customers(extract(month from DateOfBirth));
我用于测试的HP Vertica服务器版本是7.0
1) 第一投影图如下所示,对吗
create projection new_customers_idx1
as
select * from new_customers
ORDER BY CustomerId;
2) 在第二个例子中,我想没有办法实现降序排序功能,因为根据文档投影,记录只能按升序存储
create projection new_customers_idx3
as
select * from new_customers
ORDER BY Name,Age;
或者在这种情况下,可能根本没有必要创建投影
3) 第三次预测是一个重大问题。投影的选择列表中有使用表达式甚至函数的示例:
但是,我无法创建这样的投影:
create projection new_customers_idx4 AS
select CustomerId,
Name,
Age,
State,
Address,
DateOfBirth,
month(DateOfBirth) as ColAl
from new_customers
ORDER BY ColAl;
错误4241:投影的选择列表中只允许列
请给出通过投影实现功能性索引的总体提示,有没有办法创建与基于函数的索引相对应的投影?投影!=索引
不能仅仅因为OLTP数据库上有索引就创建投影。这是两个完全不同的概念
我鼓励阅读这一由三部分组成的系列文章,了解什么是投影,以及从物化视图和索引进行的比较/对比
按名称分组的查询时才有用;对于像WHERE name=?
这样的查询,它不太可能有太大的不同
我建议您从创建表开始,加载一些有意义的样本数据,然后运行该工具来确定任何其他投影是否有用。-忘记Oracle中的索引概念,了解分段,加入关键用户,按投影排序,访问等级。请参阅Kermit链接,它们将带来光明:)