Added: kylin/site/docs23/howto/howto_optimize_cubes.html URL: http://svn.apache.org/viewvc/kylin/site/docs23/howto/howto_optimize_cubes.html?rev=1822508&view=auto ============================================================================== --- kylin/site/docs23/howto/howto_optimize_cubes.html (added) +++ kylin/site/docs23/howto/howto_optimize_cubes.html Mon Jan 29 14:05:18 2018 @@ -0,0 +1,4323 @@ +<!-- +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +--> + +<!doctype html> +<html> + <!-- +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +--> + +<head> + <meta charset="utf-8"> + <meta http-equiv="X-UA-Compatible" content="IE=edge"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + + <title>Apache Kylin | Optimize Cube Design</title> + <meta name="description" content="Apache Kylin Home"> + <meta name="author" content="Apache Kylin"> + <link rel="shortcut icon" href="fav.png" type="image/png"> + + + +<link rel="stylesheet" href="/assets/css/animate.css"> +<!-- Bootstrap --> +<link rel="stylesheet" href="/assets/css/bootstrap.min.css"> + +<!-- Fonts --> +<!-- <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Alice|Open+Sans:400,300,700"> --> + +<!-- Icons --> +<link rel="stylesheet" href="/assets/css/font-awesome.min.css"> + + <!-- Custom styles --> + <link rel="stylesheet" href="/assets/css/styles.css"> + <link rel="stylesheet" href="/assets/css/docs.css"> + <link rel="stylesheet" href="/assets/css/pygments.css"> + + <link rel="canonical" href="http://kylin.apache.org/docs23/howto/howto_optimize_cubes.html"> + <link rel="alternate" type="application/rss+xml" title="Apache Kylin" href="http://kylin.apache.org/feed.xml" /> + +<!--[if lt IE 9]> <script src="assets/js/html5shiv.js"></script> <![endif]--> +<script> + (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ + (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), + m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) + })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); + + //oringal tracker for kylin.io + ga('create', 'UA-55534813-1', 'auto'); + //new tracker for kylin.apache.org + ga('create', 'UA-55534813-2', 'auto', {'name':'toplevel'}); + + ga('send', 'pageview'); + ga('toplevel.send', 'pageview'); + + +</script> +<script type="text/javascript" src="/assets/js/jquery-1.9.1.min.js"></script> +<script type="text/javascript" src="/assets/js/nside.js"></script> </script> +<script type="text/javascript" src="/assets/js/nnav.js"></script> </script> +</head> + + <body> + <!-- +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +--> + +<header id="header" > + + <div id="head" class="parallax" parallax-speed="3" > + <div id="logo" class="text-center"> <img class="img-circle" id="circlelogo" src="/assets/images/kylin_logo.jpg"> <span class="title" >Apache Kylinâ¢</span> <span class="tagline">Extreme OLAP Engine for Big Data</span> + </div> + <div class="text-center" style=" + position: relative; + top: 66px; + width: 1080px; + margin: 0 auto; + z-index: 11; + margin-top: -253px; + text-align: right;" + > + <a href="http://apache.org/foundation/contributing.html" title="Support Apache" style="margin-left: 150px;"> + <img src="https://www.apache.org/images/SupportApache-small.png" style="height: 150px; width: 150px;"> + </a> + </div> + </div> + + + <!-- Main Menu --> + <nav class="navbar navbar-default" role="navigation" id="nav-wrapper"> + <div class="container-fluid" id="nav"> + <!-- + <img class="img-circle" width="40px" height="40px" id="circlelogo" src="/assets/images/kylin_logo.jpg"> + --> + <!-- Brand and toggle get grouped for better mobile display --> + <div class="navbar-header"> + <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> + <span class="sr-only">Toggle navigation</span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + + </div> + + <!-- Collect the nav links, forms, and other content for toggling --> + <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> + <ul class="nav navbar-nav"> + <li><a href="/">Home</a></li> + <li><a href="/docs21" >Docs</a></li> + <li><a href="/download">Download</li> + <li><a href="/community" >Community</a></li> + <li><a href="/development" >Development</a></li> + <li><a href="/blog">Blog</li> + <li><a href="/cn" >䏿ç</a></li> + <li><a href="https://twitter.com/apachekylin" target="_blank" class="fa fa-twitter fa-lg" title="Twitter: @ApacheKylin" ></a></li> + <li><a href="https://github.com/apache/kylin" target="_blank" class="fa fa-github-alt fa-lg" title="Github: apache/kylin" ></a></li> + <li><a href="https://www.facebook.com/kylinio" target="_blank" class="fa fa-facebook fa-lg" title="Facebook: kylin.io" ></a></li> + </ul> + </div><!-- /.navbar-collapse --> + </div><!-- /.container-fluid --> +</nav> + </header> + + + <div class="container"> + <div class="row"> + <!-- +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +--> + +<div class="col-md-3 col-lg-3 col-xs-4 aside1 visible-md visible-lg" id="nside1" style=" padding-top: 2em"> + <ul class="nav nav-pills nav-stacked"> + + <li><a href="#titleGetting Started" data-toggle="collapse" id="navtitle">Getting Started</a></li> + <div class="collapse in"> + <div class="list-group" id="list1"> + <ul style="list-style-type:disc"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <li><a href="/docs23/index.html" class="list-group-item-lay pjaxlink" id="navlist">Overview</a></li> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <li><a href="/docs23/release_notes.html" class="list-group-item-lay pjaxlink" id="navlist">Release Notes</a></li> + + + + + + + + + + + + + + + + + + <li><a href="/docs23/gettingstarted/concepts.html" class="list-group-item-lay pjaxlink" id="navlist">Technical Concepts</a></li> + + + + + + + + + + + + + + + + + + + + + + + + <li><a href="/docs23/gettingstarted/terminology.html" class="list-group-item-lay pjaxlink" id="navlist">Terminology</a></li> + + + + + + + + + + + + + + + + + + + + + + <li><a href="/docs23/gettingstarted/faq.html" class="list-group-item-lay pjaxlink" id="navlist">FAQ</a></li> + + + + + + + + + + + + + + + + + + + + <li><a href="/docs23/gettingstarted/events.html" class="list-group-item-lay pjaxlink" id="navlist">Events and Conferences</a></li> + + + + + + + + + + + + + + + + <li><a href="/docs23/gettingstarted/best_practices.html" class="list-group-item-lay pjaxlink" id="navlist">Community Best Practices</a></li> + + + + + + + + + <ul> + </div> +</div> + + <li><a href="#titleInstallation" data-toggle="collapse" id="navtitle">Installation</a></li> + <div class="collapse in"> + <div class="list-group" id="list1"> + <ul style="list-style-type:disc"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <li><a href="/docs23/install/index.html" class="list-group-item-lay pjaxlink" id="navlist">Installation Guide</a></li> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <li><a href="/docs23/install/hadoop_env.html" class="list-group-item-lay pjaxlink" id="navlist">Hadoop Environment</a></li> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <li><a href="/docs23/install/kylin_cluster.html" class="list-group-item-lay pjaxlink" id="navlist">Deploy in Cluster Mode</a></li> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <li><a href="/docs23/install/advance_settings.html" class="list-group-item-lay pjaxlink" id="navlist">Advanced Settings</a></li> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <li><a href="/docs23/install/kylin_docker.html" class="list-group-item-lay pjaxlink" id="navlist">Run Kylin with Docker</a></li> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <li><a href="/docs23/install/kylin_aws_emr.html" class="list-group-item-lay pjaxlink" id="navlist">Install Kylin on AWS EMR</a></li> + + + + + + + + + <ul> + </div> +</div> + + <li><a href="#titleTutorial" data-toggle="collapse" id="navtitle">Tutorial</a></li> + <div class="collapse in"> + <div class="list-group" id="list1"> + <ul style="list-style-type:disc"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <li><a href="/docs23/tutorial/kylin_sample.html" class="list-group-item-lay pjaxlink" id="navlist">Quick Start with Sample Cube</a></li> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <li><a href="/docs23/tutorial/web.html" class="list-group-item-lay pjaxlink" id="navlist">Web Interface</a></li> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <li><a href="/docs23/tutorial/create_cube.html" class="list-group-item-lay pjaxlink" id="navlist">Cube Wizard</a></li> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <li><a href="/docs23/tutorial/cube_build_job.html" class="list-group-item-lay pjaxlink" id="navlist">Cube Build and Job Monitoring</a></li> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <li><a href="/docs23/tutorial/acl.html" class="list-group-item-lay pjaxlink" id="navlist">Cube Permission (v2.1.x)</a></li> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <li><a href="/docs23/tutorial/project_level_acl.html" class="list-group-item-lay pjaxlink" id="navlist">Project Level ACL</a></li> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <li><a href="/docs23/tutorial/cube_spark.html" class="list-group-item-lay pjaxlink" id="navlist">Build Cube with Spark</a></li> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <li><a href="/docs23/tutorial/cube_build_performance.html" class="list-group-item-lay pjaxlink" id="navlist">Cube Build Tuning</a></li> + + + + + + + + + <ul> + </div> +</div> + + <li><a href="#titleIntegration" data-toggle="collapse" id="navtitle">Integration</a></li> + <div class="collapse in"> + <div class="list-group" id="list1"> + <ul style="list-style-type:disc"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <li><a href="/docs23/tutorial/odbc.html" class="list-group-item-lay pjaxlink" id="navlist">Kylin ODBC Driver</a></li> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <li><a href="/docs23/tutorial/tableau.html" class="list-group-item-lay pjaxlink" id="navlist">Tableau 8</a></li> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <li><a href="/docs23/tutorial/tableau_91.html" class="list-group-item-lay pjaxlink" id="navlist">Tableau 9</a></li> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <li><a href="/docs23/tutorial/powerbi.html" class="list-group-item-lay pjaxlink" id="navlist">MS Excel and Power BI</a></li> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <li><a href="/docs23/tutorial/microstrategy.html" class="list-group-item-lay pjaxlink" id="navlist">MicroStrategy</a></li> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <li><a href="/docs23/tutorial/squirrel.html" class="list-group-item-lay pjaxlink" id="navlist">SQuirreL</a></li> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <li><a href="/docs23/tutorial/flink.html" class="list-group-item-lay pjaxlink" id="navlist">Apache Flink</a></li> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <li><a href="/docs23/tutorial/hue.html" class="list-group-item-lay pjaxlink" id="navlist">Apache Hue</a></li> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <li><a href="/docs23/tutorial/Qlik.html" class="list-group-item-lay pjaxlink" id="navlist">Qlik Sense</a></li> + + + + + + + + + <ul> + </div> +</div> + + <li><a href="#titleHow To" data-toggle="collapse" id="navtitle">How To</a></li> + <div class="collapse in"> + <div class="list-group" id="list1"> + <ul style="list-style-type:disc"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <li><a href="/docs23/howto/howto_use_restapi.html" class="list-group-item-lay pjaxlink" id="navlist">Use RESTful API</a></li> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <li><a href="/docs23/howto/howto_build_cube_with_restapi.html" class="list-group-item-lay pjaxlink" id="navlist">Build Cube with API</a></li> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <li><a href="/docs23/howto/howto_optimize_cubes.html" class="list-group-item-lay pjaxlink" id="navlist">Optimize Cube Design</a></li> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <li><a href="/docs23/howto/howto_optimize_build.html" class="list-group-item-lay pjaxlink" id="navlist">Optimize Cube Build</a></li> + + + + + + + + + + + + + + + + + + + + + + + + + + + + <li><a href="/docs23/howto/howto_backup_metadata.html" class="list-group-item-lay pjaxlink" id="navlist">Backup Metadata</a></li> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <li><a href="/docs23/howto/howto_cleanup_storage.html" class="list-group-item-lay pjaxlink" id="navlist">Cleanup Storage</a></li> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <li><a href="/docs23/howto/howto_jdbc.html" class="list-group-item-lay pjaxlink" id="navlist">Kylin JDBC Driver</a></li> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <li><a href="/docs23/howto/howto_upgrade.html" class="list-group-item-lay pjaxlink" id="navlist">Upgrade From Old Versions</a></li> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <li><a href="/docs23/howto/howto_ldap_and_sso.html" class="list-group-item-lay pjaxlink" id="navlist">Secure with LDAP and SSO</a></li> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <li><a href="/docs23/howto/howto_use_beeline.html" class="list-group-item-lay pjaxlink" id="navlist">Use Beeline for Hive</a></li> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <li><a href="/docs23/howto/howto_update_coprocessor.html" class="list-group-item-lay pjaxlink" id="navlist">Update Coprocessor</a></li> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <li><a href="/docs23/howto/howto_install_ranger_kylin_plugin.html" class="list-group-item-lay pjaxlink" id="navlist">The Ranger Kylin Plugin Installation Guide</a></li> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <li><a href="/docs23/howto/howto_enable_zookeeper_acl.html" class="list-group-item-lay pjaxlink" id="navlist">Enable zookeeper acl</a></li> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <li><a href="/docs23/howto/howto_setup_systemcube.html" class="list-group-item-lay pjaxlink" id="navlist">Set Up System Cube</a></li> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <li><a href="/docs23/howto/howto_use_cube_planner.html" class="list-group-item-lay pjaxlink" id="navlist">Use Cube Planner</a></li> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <li><a href="/docs23/howto/howto_use_dashboard.html" class="list-group-item-lay pjaxlink" id="navlist">Use Dashboard</a></li> + + + + + + + + + <ul> + </div> +</div> + + + </ul> +</div> + + <div class="col-md-9 col-lg-9 col-xs-14 aside2"> + <div id="container"> + <div id="pjax"> + <h1 class="post-title">Optimize Cube Design</h1> + + + <article class="post-content" > + <h2 id="hierarchies">Hierarchies:</h2> + +<p>Theoretically for N dimensions youâll end up with 2^N dimension combinations. However for some group of dimensions there are no need to create so many combinations. For example, if you have three dimensions: continent, country, city (In hierarchies, the âbiggerâ dimension comes first). You will only need the following three combinations of group by when you do drill down analysis:</p> + +<p>group by continent<br /> +group by continent, country<br /> +group by continent, country, city</p> + +<p>In such cases the combination count is reduced from 2^3=8 to 3, which is a great optimization. The same goes for the YEAR,QUATER,MONTH,DATE case.</p> + +<p>If we Donate the hierarchy dimension as H1,H2,H3, typical scenarios would be:</p> + +<p>A. Hierarchies on lookup table</p> + +<table> + <tr> + <td align="center">Fact table</td> + <td align="center">(joins)</td> + <td align="center">Lookup Table</td> + </tr> + <tr> + <td>column1,column2,,,,,, FK</td> + <td></td> + <td>PK,,H1,H2,H3,,,,</td> + </tr> +</table> + +<hr /> + +<p>B. Hierarchies on fact table</p> + +<table> + <tr> + <td align="center">Fact table</td> + </tr> + <tr> + <td>column1,column2,,,H1,H2,H3,,,,,,, </td> + </tr> +</table> + +<hr /> + +<p>There is a special case for scenario A, where PK on the lookup table is accidentally being part of the hierarchies. For example we have a calendar lookup table where cal_dt is the primary key:</p> + +<p>A*. Hierarchies on lookup table over its primary key</p> + +<table> + <tr> + <td align="center">Lookup Table(Calendar)</td> + </tr> + <tr> + <td>cal_dt(PK), week_beg_dt, month_beg_dt, quarter_beg_dt,,,</td> + </tr> +</table> + +<hr /> + +<p>For cases like A* what you need is another optimization called âDerived Columnsâ</p> + +<h2 id="derived-columns">Derived Columns:</h2> + +<p>Derived column is used when one or more dimensions (They must be dimension on lookup table, these columns are called âDerivedâ) can be deduced from another(Usually it is the corresponding FK, this is called the âhost columnâ)</p> + +<p>For example, suppose we have a lookup table where we join fact table and it with âwhere DimA = DimXâ. Notice in Kylin, if you choose FK into a dimension, the corresponding PK will be automatically querable, without any extra cost. The secret is that since FK and PK are always identical, Kylin can apply filters/groupby on the FK first, and transparently replace them to PK. This indicates that if we want the DimA(FK), DimX(PK), DimB, DimC in our cube, we can safely choose DimA,DimB,DimC only.</p> + +<table> + <tr> + <td align="center">Fact table</td> + <td align="center">(joins)</td> + <td align="center">Lookup Table</td> + </tr> + <tr> + <td>column1,column2,,,,,, DimA(FK) </td> + <td></td> + <td>DimX(PK),,DimB, DimC</td> + </tr> +</table> + +<hr /> + +<p>Letâs say that DimA(the dimension representing FK/PK) has a special mapping to DimB:</p> + +<table> + <tr> + <th>dimA</th> + <th>dimB</th> + <th>dimC</th> + </tr> + <tr> + <td>1</td> + <td>a</td> + <td>?</td> + </tr> + <tr> + <td>2</td> + <td>b</td> + <td>?</td> + </tr> + <tr> + <td>3</td> + <td>c</td> + <td>?</td> + </tr> + <tr> + <td>4</td> + <td>a</td> + <td>?</td> + </tr> +</table> + +<p>in this case, given a value in DimA, the value of DimB is determined, so we say dimB can be derived from DimA. When we build a cube that contains both DimA and DimB, we simple include DimA, and marking DimB as derived. Derived column(DimB) does not participant in cuboids generation:</p> + +<p>original combinations:<br /> +ABC,AB,AC,BC,A,B,C</p> + +<p>combinations when driving B from A:<br /> +AC,A,C</p> + +<p>at Runtime, in case queries like âselect count(*) from fact_table inner join looup1 group by looup1 .dimBâ, it is expecting cuboid containing DimB to answer the query. However, DimB will appear in NONE of the cuboids due to derived optimization. In this case, we modify the execution plan to make it group by DimA(its host column) first, weâll get intermediate answer like:</p> + +<table> + <tr> + <th>DimA</th> + <th>count(*)</th> + </tr> + <tr> + <td>1</td> + <td>1</td> + </tr> + <tr> + <td>2</td> + <td>1</td> + </tr> + <tr> + <td>3</td> + <td>1</td> + </tr> + <tr> + <td>4</td> + <td>1</td> + </tr> +</table> + +<p>Afterwards, Kylin will replace DimA values with DimB values(since both of their values are in lookup table, Kylin can load the whole lookup table into memory and build a mapping for them), and the intermediate result becomes:</p> + +<table> + <tr> + <th>DimB</th> + <th>count(*)</th> + </tr> + <tr> + <td>a</td> + <td>1</td> + </tr> + <tr> + <td>b</td> + <td>1</td> + </tr> + <tr> + <td>c</td> + <td>1</td> + </tr> + <tr> + <td>a</td> + <td>1</td> + </tr> +</table> + +<p>After this, the runtime SQL engine(calcite) will further aggregate the intermediate result to:</p> + +<table> + <tr> + <th>DimB</th> + <th>count(*)</th> + </tr> + <tr> + <td>a</td> + <td>2</td> + </tr> + <tr> + <td>b</td> + <td>1</td> + </tr> + <tr> + <td>c</td> + <td>1</td> + </tr> +</table> + +<p>this step happens at query runtime, this is what it means âat the cost of extra runtime aggregationâ</p> + + </article> + </div> + </div> + </div> + </div> + </div> + <!-- +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +--> + +<footer id="underfooter"> + <div class="container"> + <div class="row"> + <div class="col-md-12 widget"> + <div class="widget-body" style="text-align:center"> + <a href="http://www.apache.org"> + <img id="asf-logo" alt="Apache Software Foundation" src="/assets/images/feather-small.gif"> + </a> + + <div> + The contents of this website are © 2015 Apache Software Foundation under the terms of the <a + href="http://www.apache.org/licenses/LICENSE-2.0"> Apache License v2 </a>. Apache Kylin and + its logo are trademarks of the Apache Software Foundation. + </div> + + </div> + </div> + </div> + <!-- /row of widgets --> + + </div> + <div></div> + +</footer> + + <script src="/assets/js/jquery-1.9.1.min.js"></script> + <script src="/assets/js/bootstrap.min.js"></script> + <script src="/assets/js/main.js"></script> + </body> +</html>