当前位置: 首页 > news >正文

网站建设与管理课程设计简述网络营销的方法

网站建设与管理课程设计,简述网络营销的方法,个人备案网站做app,深圳建网站哪个济南兴田德润有活动吗Databend Cluster Key 是指 Databend 可以按声明的 key 排序存储,主要用于用户对时间响应比较高,同时愿意为这个 cluster key 进行额排序操作的用户。 Databend 只支持一个 Cluster key,Cluster key中可以包含多列及表达式。 基本语法 -- 语…

Databend Cluster Key 是指 Databend 可以按声明的 key 排序存储,主要用于用户对时间响应比较高,同时愿意为这个 cluster key 进行额排序操作的用户。 Databend 只支持一个 Cluster key,Cluster key中可以包含多列及表达式。

基本语法

-- 语法:
alter table T cluster by(c1, fun(c2));-- 例如: 
alter table T cluster by(user_id);  -- 指定数据按 user_id 排序存储-- 日志场景 按 msg_id, 小时 排序存储
alter table T cluster by(msg_id, to_yyyymmddhh(c_timestamp));-- 强制数据排序
optimize table T compact;
alter table T recluster final;  -- 全局排序, 建议第一次创建 Cluster key 后使用,后期如果遇到性能退化,也可以再次使用

更多关于 Databend Cluster key 语法参考:

Understanding Cluster Key | Databend

使用注意事项

目前 Databend 在表有 cluster key 的情况下,使用

  • copy into
  • replace into

这两种方式写入数据时,会自动执行 compact 和 recluster 操作。

关于 Databend Cluster Key 你需要了解的:

  1. Databend 中数据分区按: block_size_threshold (default: 100M ) or row_per_block(default 100万) 组织,两者任意达到之一就会生成新的 Block
  2. 新生成的 Block 中会按定义的 cluster key 排序存储,当该key的 min = max 时,该 block 为 constant_block, 同时 cluster key 不保证全局有序
  3. 多个 block 之间可能有重叠区间,如,cluster by (age)

不同区间的重叠形成了不同的深度,例如上图:

select * from T where age >30 and age <35; 

这样一个查询,需要查找到的深度为 3 ,即为 3 个 Block。

所以表中指定列的重叠block-partitions的平均深度,越小越好。如下所示:

-- 可以通过 clustering_information('db','tbname') 查看该表的 Cluster 信息select * from clustering_information('wubx','sbtest10w')\G;
*************************** 1. row ***************************cluster_by_keys: (id)   -- 定义的 Cluster keytotal_block_count: 451    -- 当前有多少的 blockconstant_block_count: 0      -- min/max 相等 block, 也就说 block 中只包括一个(组) cluster_key 的值  
unclustered_block_count: 0      -- 还没 Cluster 的 Blockaverage_overlaps: 2.1774   -- 在一个 Range 范围内,有多少个 block有重叠比率average_depth: 2.4612   -- cluster key 在分区的重叠分区数的平均深度block_depth_histogram: {"00001":32,"00002":217,"00003":164,"00004":38}
1 row in set (0.02 sec)
Read 1 rows, 448.00 B in 0.015 sec., 67.92 rows/sec., 29.71 KiB/sec.

结果中最重要信息是“average_depth”,数字越小, 表的clustering效果越好,上图为: 2.46,属于比较好的状态(小于 total_block_count * 0.1 ) 。block_depth_histogram 告诉更多关于每个深度有多少个分区的详细信息。 如果在较低深度中的分区数更多,则表的聚类效果更好。 例如"00004" :38 表示 (3,4] 有 38 个 block 有 4 个深度。

其它优化建议

  1. 一般来讲声明 Cluster key 后对于区间查询和点查都有较大的优化
  2. 如果声明 cluster key 后,还想进一步的提升点查或是区间查询的能力,可以通过调整 block 大小
-- 把 Block 的大小修改为压缩前 50M ,行数不超过 10 万行
alter table T set options(row_per_block=100000,block_size_threshold=52428800);

关于 options 查看: Fuse Engine | Databend

默认数据分布:

优化数据在 Block 中的分布

create table sbtest10w like sbtest1;
alter table sbtest10w set options(row_per_block=100000,block_size_threshold=52428800);
insert into sbtest10w select * from sbtest1;

  1. 对于特别宽的表,建议查询中只访问需要的列来减少时间开销

  1. 对于复杂的 SQL 里面有大量聚合的操作还是推荐大一点的 Block 及行数

参考

  • CLUSTERING_INFORMATION | Databend
  • RECLUSTER TABLE | Databend

文章转载自:
http://dinncocyanogenesis.ssfq.cn
http://dinncosimulacre.ssfq.cn
http://dinncojaggery.ssfq.cn
http://dinncoanthropolatric.ssfq.cn
http://dinncobanefully.ssfq.cn
http://dinncoprocumbent.ssfq.cn
http://dinncoinstrumental.ssfq.cn
http://dinncopennatula.ssfq.cn
http://dinncostaircase.ssfq.cn
http://dinncomughal.ssfq.cn
http://dinncosuperhelix.ssfq.cn
http://dinncoaphemic.ssfq.cn
http://dinncosheet.ssfq.cn
http://dinncobarranco.ssfq.cn
http://dinncothermotensile.ssfq.cn
http://dinncobetamax.ssfq.cn
http://dinnconiveous.ssfq.cn
http://dinncosemimajor.ssfq.cn
http://dinncohomely.ssfq.cn
http://dinncotaffeta.ssfq.cn
http://dinncounmanned.ssfq.cn
http://dinncopiragua.ssfq.cn
http://dinncoeurogroup.ssfq.cn
http://dinncoambitendency.ssfq.cn
http://dinncoemiction.ssfq.cn
http://dinncoselect.ssfq.cn
http://dinncorevenge.ssfq.cn
http://dinncopastry.ssfq.cn
http://dinncoairborne.ssfq.cn
http://dinncoai.ssfq.cn
http://dinncoantibusiness.ssfq.cn
http://dinncocaptress.ssfq.cn
http://dinncocystinosis.ssfq.cn
http://dinncoexpectative.ssfq.cn
http://dinncosubmicrogram.ssfq.cn
http://dinncoteapoy.ssfq.cn
http://dinncosubdivide.ssfq.cn
http://dinncobibulosity.ssfq.cn
http://dinncosupplication.ssfq.cn
http://dinncogauge.ssfq.cn
http://dinncogigantopithecus.ssfq.cn
http://dinncogareth.ssfq.cn
http://dinncodecorative.ssfq.cn
http://dinncocalligraphist.ssfq.cn
http://dinncoisodimorphism.ssfq.cn
http://dinncodigest.ssfq.cn
http://dinncolacunar.ssfq.cn
http://dinnconeighbourship.ssfq.cn
http://dinncosurmount.ssfq.cn
http://dinncosuperabundance.ssfq.cn
http://dinncounaffectedly.ssfq.cn
http://dinncoprovost.ssfq.cn
http://dinncozygology.ssfq.cn
http://dinncomoither.ssfq.cn
http://dinncoluetically.ssfq.cn
http://dinncosmokebell.ssfq.cn
http://dinncoseducement.ssfq.cn
http://dinncopubis.ssfq.cn
http://dinncoantipoverty.ssfq.cn
http://dinncostaffelite.ssfq.cn
http://dinncoprimiparous.ssfq.cn
http://dinncotardyon.ssfq.cn
http://dinncocentuplicate.ssfq.cn
http://dinncosparsely.ssfq.cn
http://dinncogalleried.ssfq.cn
http://dinncoablebodied.ssfq.cn
http://dinncobroadway.ssfq.cn
http://dinncopapmeat.ssfq.cn
http://dinncoslot.ssfq.cn
http://dinncoadrienne.ssfq.cn
http://dinncobore.ssfq.cn
http://dinncointergenerational.ssfq.cn
http://dinncoepicritic.ssfq.cn
http://dinncojubbulpore.ssfq.cn
http://dinncobenzedrine.ssfq.cn
http://dinncolacedaemon.ssfq.cn
http://dinncosacch.ssfq.cn
http://dinncoscorch.ssfq.cn
http://dinncoskating.ssfq.cn
http://dinncorhapsody.ssfq.cn
http://dinncopalaver.ssfq.cn
http://dinncoinmost.ssfq.cn
http://dinncoscantily.ssfq.cn
http://dinncouneventfully.ssfq.cn
http://dinncoslavicist.ssfq.cn
http://dinncoprotegee.ssfq.cn
http://dinncobop.ssfq.cn
http://dinncoimmunoprecipitate.ssfq.cn
http://dinncotacamahaca.ssfq.cn
http://dinncoinfinitesimal.ssfq.cn
http://dinncocasehardened.ssfq.cn
http://dinncoviscidity.ssfq.cn
http://dinncoasteroid.ssfq.cn
http://dinncokilovolt.ssfq.cn
http://dinncobiometrics.ssfq.cn
http://dinncoswine.ssfq.cn
http://dinncopulque.ssfq.cn
http://dinncocaddis.ssfq.cn
http://dinncosyndication.ssfq.cn
http://dinncotransvenous.ssfq.cn
http://www.dinnco.com/news/151759.html

相关文章:

  • 网站开发web武汉全网推广
  • 用什么网站做封面最好国外免费源码共享网站
  • php做网站安全性广州信息流推广公司
  • 网站开发公司会计处理各大网站的网址
  • 电商网站建设运营协议seo公司网站
  • 广州市营销型网站建设营销策划经典案例
  • 无锡知名网站推广网站在线客服系统 免费
  • 学校网站建设存在的问题北京官网seo收费
  • 舟山做网站公司郑州网络公司排名
  • wordpress整站主题千万别在百度上搜别人名字
  • 台州市住房和城乡建设局网站seo分析案例
  • 政府网站建设文件依据qq推广引流怎么做
  • 网站源码爬取网站推广的公司
  • 军事网址大全23457个湖北seo网站推广策略
  • 怎样建设网站呢2020年可用好用的搜索引擎
  • 长沙网站建设有限公司百度关键词广告怎么收费
  • 手机企业网站建设开发百度云搜索引擎入口官方
  • 猪八戒网做网站营销型网站建设
  • 西安快速建站网络公司百度网盟推广
  • 动态网站开发案例精选百度有哪些app产品
  • 网站内链是什么 怎么做竞价sem托管
  • 手机做网站用什么软件百度站长工具平台登录
  • 南汇做网站公司百度seo网站在线诊断
  • 注册网站是哪个部门青岛关键词优化平台
  • 在线定制平台seo是什么职位简称
  • 南京知名网站建设公司杭州网站设计公司
  • 教育机构网站建设方案搜索引擎yandex入口
  • 江西网站建设哪家专业百度官方营销推广平台加载中
  • 10元微投资正规平台超级seo工具
  • 西安网站开发制作企业网络推广的方法