Query performance optimization of Vertica
- Don't fetch any data that you don't need,or don't fetch any columns that you don't need. Because retrieving more data or more columns, which can increase network,I/O,memory and CPU overhead for the server. For example, if you need several columns you can use
AT EPOCH LATEST
SELECT fi.name, fi.InvestmentKey,id.VendorId,id.CUSIP,id.ISIN,id.DomicileCountryId,id.CurrencyId
FROM dbo.FixedIncome fi
INNER JOIN dbo.InvestmentIdDimension id ON id.InvestmentKey = fi.InvestmentKey
WHERE id.InvestmentId = 'B000023K1X'
But do not use:
AT EPOCH LATEST
SELECT fi.*, id.*
FROM dbo.FixedIncome fi
INNER JOIN dbo.InvestmentIdDimension id ON id.InvestmentKey = fi.InvestmentKey
WHERE id.InvestmentId = 'B000023K1X' - To avoid blocking Vertica write process, we alway add the "AT EPOCH
LATEST" for query,which is snapshot read. for example, You can use
AT EPOCH LATEST SELECT ... FROM ...,
But do not use:
SELECT ... FROM ... - Chop up a complex query to many simpler queries.
- Join decomposition, if posible, Sometimes, Using "In" clause or sub
query clause instead of a complex "JOIN" clause. like this, we can use
AT EPOCH LATEST
SELECT s1.CompanyId, id.InvestmentId, s1.InvestmentKey,id.VendorId,id.CUSIP,id.ISIN,id.DomicileCountryId,id.CurrencyId
FROM ( SELECT CompanyId,InvestmentKey FROM dbo.FixedIncome WHERE CompanyId = '0C00000BDL') s1
INNER JOIN dbo.InvestmentIdDimension id ON id.InvestmentKey = s1.InvestmentKey
WHERE id.VendorId = 101 OR id.VendorId = 102;
But do not use:
AT EPOCH LATEST
SELECT s1.CompanyId, id.InvestmentId, s1.InvestmentKey,id.VendorId,id.CUSIP,id.ISIN,id.DomicileCountryId,id.CurrencyId
FROM dbo.FixedIncome fi
INNER JOIN dbo.InvestmentIdDimension id ON id.InvestmentKey = s1.InvestmentKey
WHERE fi.CompanyId = '0C00000BDL' AND( id.VendorId = 101 OR id.VendorId = 102 ); - Try to use the temporary table to cache data, which can avoid scan an physical table for times.
- Try to push the outer predicate into the inner subquery clause, so that it is evaluated before the analytic computation
- For Top-K query, if posible, we'd better omit the order by clause, Or we'd better adding a filter condition for it.
- For sort operation, We can create Pre-sorted projections, so the
vertica can choose the faster Group By Pipeline over Group By Hash - Please refer to the "Optimizing Query Performance" chapter in
reference manual of vertica, which doc's name is "Communiti Vertica
Community Edition 6.0"
[https://my.vertica.com/docs/CE/6.0.1/HTML/index.htm#12525.htm ]
Query performance optimization of Vertica的更多相关文章
- Goal driven performance optimization
When your goal is to optimize application performance it is very important to understand what goal d ...
- opengl performance optimization
OpenGL 性能优化 作者: Yang Jian (jyang@cad.zju.edu.cn) 日期: 2009-05-04 本文从硬件体系结构.状态机.光照.纹理.顶点数组.LOD.Cull等方面 ...
- Java Performance Optimization Tools and Techniques for Turbocharged Apps--reference
Java Performance Optimization by: Pierre-Hugues Charbonneau reference:http://refcardz.dzone.com/refc ...
- Development of large-scale site performance optimization method from LiveJournal background
A LiveJournal course of development is a project in the 99 years began in the campus, a few people d ...
- Performance Optimization (2)
DesktopGood performance is critical to the success of many games. Below are some simple guidelines f ...
- Chrome DevTools & performance optimization
Chrome DevTools & performance ptimization https://www.bing.com https://developers.google.com/web ...
- 网站性能优化(website performance optimization)2
我们先研究下构建渲染树前的几个步骤:也就是DOM和CSSOM,通常这些步骤的效果最差使你的网页呈现速度非常慢,我们是讨论尽可能快的将HTML流式传输给客户端,使浏览器能够开始构建DOM,还有其他注意事 ...
- Android Performance Optimization
1.zipalign 2.ui优化 3.package size 4.RenderScript 5.Resource Shrinking & Code Shrinking 6.java cod ...
- 网站性能优化(website performance optimization)
提高代码运行速度,或许我们从来没有优化这些页面来提高速度 想要开发优秀的网站,你必须了解你的用户,知道他们想要达到什么目的,同时还要明白浏览器的工作原理,从而能够打造快速良好的体验,我最近在PageS ...
随机推荐
- 【QTP专题】05_参数化之Excel
QTP使用外部Excel实现参数化主要有以下两种方式 导入到DataTable中 Syntax:DataTable.ImportSheet(FileName, SheetSource, SheetDe ...
- hdu5693 D game&&hdu 5712 D++ game
题目链接:5693 题目链接:5712 对于这个D game.注意消除之后两遍的序列是可以拼合到一起的!我们可以想到有区间DP的做法.我们设\(f[i][j]\)表示区间i,j可以被消除. 显然如果这 ...
- Windows10使用
1.常见问题 Win10 的操作中心如果不见了 Windows10电脑系统时间校准 实现windows与ubuntu的之间的复制与粘贴 安卓手机传递文件到Windows系统电脑 安卓手机高速传递文件到 ...
- ie7 a标签强制不换行兼容问题
a内容错乱如图所示: 解决方法:加个样式就行white-space:nowrap; 最终效果图: 添加了white-space:nowrap 之后, 这样就强制一段文字不会自动换行了.
- linux kvm虚拟机安装
1.上传ISO文件,这里采用OEL5.8x64iso 2.开始安装OEL5.8 (1)raw格式磁盘 virt- --vcpus= --disk path=/data/test02.img,size= ...
- pandas筛选数据。
https://jingyan.baidu.com/article/0eb457e508b6d303f0a90572.html 假如我们想要筛选D列数据中大于0的行:df[df['D']>0] ...
- word的xml文件中空白页和换页
■ word中分页符(插入空白页): <w:r> <w:rPr> <w:rFonts w:as ...
- maven初步了解
目标:创建一个父maven项目,有两个子项目分别为serverCenter,dbConnector. 建议:全程不要导入Jar包,全部使用maven依赖的方式导入包. 1.创建maven项目 这个创建 ...
- ResourceBundle和Locale
一.认识国际化资源文件 这个类提供软件国际化的捷径.通过此类,可以使您所编写的程序可以: 轻松地本地化或翻译成不同的语言 一次处理多个语言环境 ...
- python模块与包详解
<1>.模块:任何 *.py 的文件都可以当作模块使用 import 导入 >>>improt test >>>b=test.a() >> ...