blob: 44b767daf61a834e150021af0c496c8612178b2f [file] [log] [blame]
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-61232409-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-61232409-1');
</script>
<!-- Yandex.Metrika counter -->
<script type="text/javascript" >
(function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};
m[i].l=1*new Date();k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)})
(window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym");
ym(72949126, "init", {
clickmap:true,
trackLinks:true,
accurateTrackBounce:true,
webvisor:true
});
</script>
<noscript><div><img src="https://mc.yandex.ru/watch/72949126" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
<!-- /Yandex.Metrika counter -->
<!-- Bugyard widget embed -->
<script type="text/javascript">!function(){if("function"!=typeof window.bugyard){var a=function(){a.c(arguments)};a.q=[],a.c=function(b){a.q.push(b)},window.bugyard=a;var b=document.createElement("script");b.setAttribute("data-bugyard","610961912c35ff001493163a"),b.setAttribute("async","async"),b.setAttribute("defer","defer"),b.setAttribute("src","https://widget.bugyard.io/bugyard.min.js"),document.getElementsByTagName("head")[0].appendChild(b)}}(); window.bugyard("hideButton"); </script>
<link rel="preload" href='/assets/js/code-tabs.js?1' as="script" crossorigin>
<link rel="preload" href='/assets/js/page-nav.js' as="script" crossorigin>
<link rel="preload" href='/assets/js/docs-menu.js?20201005' as="script" crossorigin>
<style>:root{--gg-red:#ec1c24;--gg-orange:#ec1c24;--gg-orange-dark:#bc440b;--gg-orange-filter:invert(47%) sepia(61%) saturate(1950%) hue-rotate(345deg) brightness(100%) contrast(95%);--gg-dark-gray:#333333;--orange-line-thickness:3px;--block-code-background:rgba(241, 241, 241, 20%);--inline-code-background:rgba(241, 241, 241, 90%);--padding-top:25px;--link-color:#ec1c24;--body-background:#fcfcfc}header{min-height:var(--header-height);background:#fff;box-shadow:0 4px 10px 0 #eee,0 0 4px 0 #d5d5d5;z-index:1}header>.container{display:grid;grid-template-columns:auto auto 1fr auto auto auto;grid-template-areas:'left-toggle home nav ver api search lang';grid-template-rows:40px;flex-direction:row;align-items:center;justify-content:flex-start;padding:12px 20px;max-width:1400px;margin:0 auto}header nav>ul{padding:0;margin:0;list-style:none;display:inherit}header .dropdown{display:none;position:fixed;top:calc(var(--header-height) - 12px);width:auto;background:#fff;box-shadow:0 4px 4px 0 rgba(0,0,0,.24),0 0 4px 0 rgba(0,0,0,.12);border-radius:4px;padding-top:10px;padding-bottom:12px;z-index:2}header .dropdown li{display:flex}header .dropdown a{color:grey!important;font-size:16px;padding-top:5px;padding-bottom:4px}header .menu{border:none;background:0 0;width:40px;height:40px;margin-right:12px;grid-area:left-toggle}header .menu img{width:18px;height:12px}header .search-close,header .top-nav-toggle{background:0 0;border:none;padding:0;width:36px;height:36px;display:inline-flex;align-items:center;justify-content:center;color:var(--gg-dark-gray);font-size:26px}header .search-toggle{grid-area:search}header .top-nav-toggle{grid-area:top-toggle}header .home{grid-area:home;margin-right:auto}header .home img{height:36px}header #api-docs{grid-area:api;margin:0;display:flex}header #api-docs .dropdown{padding:.5em 0}header #api-docs a{padding:9px 14px;color:var(--gg-dark-gray)!important;text-decoration:none;white-space:nowrap}header #api-docs .dropdown-item a{font-weight:400;display:block;width:100%;min-width:150px}header #lang-selector li{list-style:none;display:flex;padding:9px 14px}header #lang-selector li a{display:flex;color:#000;align-items:center}header #lang-selector li a span{font-size:10px;margin-left:5px}header #lang-selector li a img{width:25px}header #lang-selector li .dropdown{margin-left:-70px}header #lang-selector li .dropdown .dropdown-item{padding:0 1em;margin-bottom:8px}header #lang-selector li .dropdown .dropdown-item a span{font-size:14px}header .search{margin-left:auto;margin-right:20px;grid-area:search}header .search input[type=search]{color:var(--gg-dark-gray);background:rgba(255,255,255,.8);border:1px solid #ccc;padding:10px 15px;font-family:inherit;max-width:148px;height:37px;font-size:14px;-webkit-appearance:unset;appearance:unset}header #version-selector{list-style:none;grid-area:ver;line-height:28px;border-radius:0;margin-right:10px;border:none;color:var(--gg-dark-gray);padding:5px 16px 5px 10px;white-space:nowrap;font-size:14px;width:auto;text-align:right;box-sizing:border-box;text-align-last:right;-moz-appearance:none;-webkit-appearance:none;appearance:none;direction:rtl}header #version-selector option{direction:ltr}header>nav{grid-area:nav;font-size:18px;display:flex;flex-direction:row;margin:0 20px}header #lang-selector{grid-area:lang}header .search-close{margin-right:10px}@media (max-width:600px){header .search{margin-right:5px}header .search input[type=search]{max-width:110px}}header:not(.narrow-header) .search-close,header:not(.narrow-header) .top-nav-toggle{display:none}@media (max-width:670px){header>.container{grid-template-columns:auto 1fr auto;grid-template-areas:'left-toggle home search' 'ver api lang'}header #lang-selector li{justify-content:flex-end}}pre,pre.rouge{padding:8px 15px;background:var(--block-code-background)!important;border-radius:5px;border:1px solid #e5e5e5;overflow-x:auto;min-height:36px;line-height:18px;color:#545454}code{color:#545454}pre.rouge code{background:0 0!important}:not(pre)>code{background:var(--inline-code-background);padding:.1em .5em;background-clip:padding-box;border-radius:3px;color:#545454;font-size:90%}.listingblock .content{position:relative}.highlight{color:#586e75}.highlight .c1{color:#657b83}.highlight .nt{color:#b58900}.highlight .o{color:#93a1a1}.highlight .k{color:#6c71c4}.highlight .kt{color:#cb4b16}.highlight .s,.highlight .s1{color:#859900}.highlight .nc{color:#b58900}.highlight .na{color:#268bd2}body{font-family:'Open Sans',sans-serif}h1,h2{color:#000;font-weight:400;font-family:'Open Sans'}h1{font-size:36px;line-height:40px}a{text-decoration:none;color:var(--link-color)}section{color:#545454}.admonitionblock .icon .title{display:none}body{--header-height:64px;--promotion-bar-height:35px;--footer-height:104px;--footer-gap:60px;padding:0;margin:0;display:flex;flex-direction:column;min-height:100vh;background-color:var(--body-background);font-family:'Open Sans',sans-serif}body>section{flex:1}header{position:-webkit-sticky;position:sticky;top:0;z-index:2}*{box-sizing:border-box}@media (max-width:670px){body{--header-height:97px}}.left-nav{padding:10px 20px;width:289px;overflow-y:auto;top:calc(var(--header-height) + var(--promotion-bar-height));height:calc(100vh - var(--header-height) - var(--promotion-bar-height));font-family:'Open Sans';padding-top:var(--padding-top);background-color:var(--body-background)}.left-nav li{list-style:none}.left-nav a,.left-nav button{text-decoration:none;color:#757575;font-size:16px;display:inline-flex;width:100%;margin:2px 0;padding:.25em .375em;background:0 0;border:none;font:inherit;text-align:left}.left-nav a.active{color:var(--link-color)}.left-nav .nav-group{margin-left:6px;font-size:14px}.left-nav nav{border-left:2px solid #ddd;margin-bottom:5px}.left-nav nav.collapsed{display:none}.left-nav nav>li>a,.left-nav nav>li>button{padding-left:20px;text-align:left}.left-nav nav>li>a.active{border-left:var(--orange-line-thickness) solid var(--active-color);padding-left:calc(20px - var(--orange-line-thickness))}.left-nav nav.sub_pages{border:none}.left-nav nav.sub_pages a{padding-left:32px}.left-nav .state-indicator{margin-left:auto;margin-top:5px;width:6.2px;height:10px;flex:0 0 auto;filter:invert(49%) sepia(4%) saturate(5%) hue-rotate(23deg) brightness(92%) contrast(90%)}.left-nav button.expanded .state-indicator{transform:rotate(90deg)}.right-nav{width:289px;padding:12px 26px;overflow-y:auto;height:calc(100vh - var(--header-height));top:0;position:-webkit-sticky;position:sticky;display:flex;flex-direction:column;font-family:'Open sans';padding-top:var(--padding-top);background-color:#fff}.right-nav ul{list-style:none;padding:0;margin:0}.right-nav li{padding:0}.right-nav a{--border-width:0px;font-size:14px;color:#757575;padding-left:calc(15px * var(--nesting-level) + 8px - var(--border-width));margin:.3em 0;display:inline-block}.right-nav .sectlevel1{border-left:2px solid #ddd}.right-nav .sectlevel1{--nesting-level:0}.right-nav .sectlevel2{--nesting-level:1}.right-nav .sectlevel3{--nesting-level:2}@media (max-width:1200px){.right-nav{width:230px}}.right-nav footer{font-size:12px;padding:calc(var(--footer-gap) * .3) 0 5px;text-align:left;margin:auto 0 0}section.page-docs{display:grid;grid-template-columns:auto 1fr auto;grid-template-rows:100%;grid-template-areas:'left-nav content right-nav';line-height:20px;max-width:1440px;margin:auto;width:100%}section.page-docs>article{border-left:1px solid #eee;background-color:#fff;padding:0 50px 30px;grid-area:content;overflow:hidden;font-family:sans-serif;font-size:16px;color:#545454;line-height:1.6em}section.page-docs>article h1,section.page-docs>article h2{font-family:'Open Sans'}@media (max-width:800px){section.page-docs>article{padding-left:15px;padding-right:15px}}section.page-docs .edit-link{position:relative;top:10px;right:10px;float:right;padding-top:calc(var(--header-height) + var(--padding-top));margin-top:calc((-1 * var(--header-height)))}section.page-docs h1,section.page-docs h2{margin-bottom:0}section.page-docs h2[id]{margin-top:var(--margin-top);margin-bottom:calc(var(--margin-top) * .5);z-index:-1}section.page-docs .title{font-style:italic}section.page-docs h2[id]{--margin-top:1.2em}.left-nav{bottom:0;position:-webkit-sticky;position:sticky}.left-nav{grid-area:left-nav}.right-nav{grid-area:right-nav}.left-nav__overlay{display:none;background:rgba(0,0,0,.5);z-index:1;position:fixed;top:var(--header-height);bottom:0;left:0;right:0}@media (max-width:990px){body:not(.hide-left-nav) .left-nav__overlay{display:block}nav.left-nav{background:#fafafa;grid-area:left-nav;box-shadow:0 4px 4px 0 rgba(0,0,0,.24),0 0 4px 0 rgba(0,0,0,.12);min-height:calc(100vh - var(--header-height));max-height:calc(100vh - var(--header-height));position:fixed;bottom:0;top:var(--header-height);z-index:2}section.page-docs>article{grid-column-start:left-nav;grid-column-end:content;grid-row:content}}@media (max-width:800px){nav.right-nav{display:none}}:target:before{content:"";display:block;margin-top:calc(var(--header-height) * -1);height:var(--header-height);width:1px}@media (min-width:600px) and (max-width:900px){:target:before{content:"";display:block;width:1px;margin-top:-150px;height:150px}}
#header #promotion-bar { background-color: #333333; padding: 8px; }
#header #promotion-bar p { font-size: 14px; line-height: 1.4em; font-weight: 600; padding: 0; margin: 0; color: #f0f0f0; text-align: center;}
#header #promotion-bar p a { color: #FCB903; } </style>
<meta name="ignite-version" content="2.13.0" />
<title>Ddl | Ignite Documentation</title>
<link rel="canonical" href="/docs/latest/sql-reference/ddl" />
<link rel="shortcut icon" href="/favicon.ico">
<meta name='viewport' content='width=device-width, height=device-height, initial-scale=1.0, minimum-scale=1.0'>
<link rel="preload" as="style" href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;600;700&display=swap" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;600;700&display=swap" media="print" onload="this.media='all'">
<noscript>
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;600;700&display=swap" rel="stylesheet">
</noscript>
<script>
// AnchorJS - v4.2.0 - 2019-01-01
// https://github.com/bryanbraun/anchorjs
// Copyright (c) 2019 Bryan Braun; Licensed MIT
!function(A,e){"use strict";"function"==typeof define&&define.amd?define([],e):"object"==typeof module&&module.exports?module.exports=e():(A.AnchorJS=e(),A.anchors=new A.AnchorJS)}(this,function(){"use strict";return function(A){function f(A){A.icon=A.hasOwnProperty("icon")?A.icon:"",A.visible=A.hasOwnProperty("visible")?A.visible:"hover",A.placement=A.hasOwnProperty("placement")?A.placement:"right",A.ariaLabel=A.hasOwnProperty("ariaLabel")?A.ariaLabel:"Anchor",A.class=A.hasOwnProperty("class")?A.class:"",A.base=A.hasOwnProperty("base")?A.base:"",A.truncate=A.hasOwnProperty("truncate")?Math.floor(A.truncate):64,A.titleText=A.hasOwnProperty("titleText")?A.titleText:""}function p(A){var e;if("string"==typeof A||A instanceof String)e=[].slice.call(document.querySelectorAll(A));else{if(!(Array.isArray(A)||A instanceof NodeList))throw new Error("The selector provided to AnchorJS was invalid.");e=[].slice.call(A)}return e}this.options=A||{},this.elements=[],f(this.options),this.isTouchDevice=function(){return!!("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)},this.add=function(A){var e,t,i,n,o,s,a,r,c,h,l,u,d=[];if(f(this.options),"touch"===(l=this.options.visible)&&(l=this.isTouchDevice()?"always":"hover"),A||(A="h2, h3, h4, h5, h6"),0===(e=p(A)).length)return this;for(function(){if(null===document.head.querySelector("style.anchorjs")){var A,e=document.createElement("style");e.className="anchorjs",e.appendChild(document.createTextNode("")),void 0===(A=document.head.querySelector('[rel="stylesheet"], style'))?document.head.appendChild(e):document.head.insertBefore(e,A),e.sheet.insertRule(" .anchorjs-link { opacity: 0; text-decoration: none; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }",e.sheet.cssRules.length),e.sheet.insertRule(" *:hover > .anchorjs-link, .anchorjs-link:focus { opacity: 1; }",e.sheet.cssRules.length),e.sheet.insertRule(" [data-anchorjs-icon]::after { content: attr(data-anchorjs-icon); }",e.sheet.cssRules.length),e.sheet.insertRule(' @font-face { font-family: "anchorjs-icons"; src: url(data:n/a;base64,AAEAAAALAIAAAwAwT1MvMg8yG2cAAAE4AAAAYGNtYXDp3gC3AAABpAAAAExnYXNwAAAAEAAAA9wAAAAIZ2x5ZlQCcfwAAAH4AAABCGhlYWQHFvHyAAAAvAAAADZoaGVhBnACFwAAAPQAAAAkaG10eASAADEAAAGYAAAADGxvY2EACACEAAAB8AAAAAhtYXhwAAYAVwAAARgAAAAgbmFtZQGOH9cAAAMAAAAAunBvc3QAAwAAAAADvAAAACAAAQAAAAEAAHzE2p9fDzz1AAkEAAAAAADRecUWAAAAANQA6R8AAAAAAoACwAAAAAgAAgAAAAAAAAABAAADwP/AAAACgAAA/9MCrQABAAAAAAAAAAAAAAAAAAAAAwABAAAAAwBVAAIAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAMCQAGQAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAg//0DwP/AAEADwABAAAAAAQAAAAAAAAAAAAAAIAAAAAAAAAIAAAACgAAxAAAAAwAAAAMAAAAcAAEAAwAAABwAAwABAAAAHAAEADAAAAAIAAgAAgAAACDpy//9//8AAAAg6cv//f///+EWNwADAAEAAAAAAAAAAAAAAAAACACEAAEAAAAAAAAAAAAAAAAxAAACAAQARAKAAsAAKwBUAAABIiYnJjQ3NzY2MzIWFxYUBwcGIicmNDc3NjQnJiYjIgYHBwYUFxYUBwYGIwciJicmNDc3NjIXFhQHBwYUFxYWMzI2Nzc2NCcmNDc2MhcWFAcHBgYjARQGDAUtLXoWOR8fORYtLTgKGwoKCjgaGg0gEhIgDXoaGgkJBQwHdR85Fi0tOAobCgoKOBoaDSASEiANehoaCQkKGwotLXoWOR8BMwUFLYEuehYXFxYugC44CQkKGwo4GkoaDQ0NDXoaShoKGwoFBe8XFi6ALjgJCQobCjgaShoNDQ0NehpKGgobCgoKLYEuehYXAAAADACWAAEAAAAAAAEACAAAAAEAAAAAAAIAAwAIAAEAAAAAAAMACAAAAAEAAAAAAAQACAAAAAEAAAAAAAUAAQALAAEAAAAAAAYACAAAAAMAAQQJAAEAEAAMAAMAAQQJAAIABgAcAAMAAQQJAAMAEAAMAAMAAQQJAAQAEAAMAAMAAQQJAAUAAgAiAAMAAQQJAAYAEAAMYW5jaG9yanM0MDBAAGEAbgBjAGgAbwByAGoAcwA0ADAAMABAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAH//wAP) format("truetype"); }',e.sheet.cssRules.length)}}(),t=document.querySelectorAll("[id]"),i=[].map.call(t,function(A){return A.id}),o=0;o<e.length;o++)if(this.hasAnchorJSLink(e[o]))d.push(o);else{if(e[o].hasAttribute("id"))n=e[o].getAttribute("id");else if(e[o].hasAttribute("data-anchor-id"))n=e[o].getAttribute("data-anchor-id");else{for(c=r=this.urlify(e[o].textContent),a=0;void 0!==s&&(c=r+"-"+a),a+=1,-1!==(s=i.indexOf(c)););s=void 0,i.push(c),e[o].setAttribute("id",c),n=c}n.replace(/-/g," "),(h=document.createElement("a")).className="anchorjs-link "+this.options.class,h.setAttribute("aria-label",this.options.ariaLabel),h.setAttribute("data-anchorjs-icon",this.options.icon),this.options.titleText&&(h.title=this.options.titleText),u=document.querySelector("base")?window.location.pathname+window.location.search:"",u=this.options.base||u,h.href=u+"#"+n,"always"===l&&(h.style.opacity="1"),""===this.options.icon&&(h.style.font="1em/1 anchorjs-icons","left"===this.options.placement&&(h.style.lineHeight="inherit")),"left"===this.options.placement?(h.style.position="absolute",h.style.marginLeft="-1em",h.style.paddingRight="0.5em",e[o].insertBefore(h,e[o].firstChild)):(h.style.paddingLeft="0.375em",e[o].appendChild(h))}for(o=0;o<d.length;o++)e.splice(d[o]-o,1);return this.elements=this.elements.concat(e),this},this.remove=function(A){for(var e,t,i=p(A),n=0;n<i.length;n++)(t=i[n].querySelector(".anchorjs-link"))&&(-1!==(e=this.elements.indexOf(i[n]))&&this.elements.splice(e,1),i[n].removeChild(t));return this},this.removeAll=function(){this.remove(this.elements)},this.urlify=function(A){return this.options.truncate||f(this.options),A.trim().replace(/\'/gi,"").replace(/[& +$,:;=?@"#{}|^~[`%!'<>\]\.\/\(\)\*\\\n\t\b\v]/g,"-").replace(/-{2,}/g,"-").substring(0,this.options.truncate).replace(/^-+|-+$/gm,"").toLowerCase()},this.hasAnchorJSLink=function(A){var e=A.firstChild&&-1<(" "+A.firstChild.className+" ").indexOf(" anchorjs-link "),t=A.lastChild&&-1<(" "+A.lastChild.className+" ").indexOf(" anchorjs-link ");return e||t||!1}}});
</script>
</head>
<body>
<header>
<!--#include virtual="/includes/promotion_banner.html" -->
<div class="container">
<button type='button' class='menu' title='Docs menu'>
<img src="/assets/images/menu-icon.svg" width="18" height="12" alt="menu icon" />
</button>
<div class='home'>
<a href="/" class='home' title='Apache Ignite home'>
<img src="/assets/images/apache_ignite_logo.svg" alt="Apache Ignite logo" width="103" height="36" >
</a>
</div>
<select id="version-selector">
<option value="2.13.0">2.13.0</option>
</select>
<nav id="api-docs"><ul>
<li><a href="#">APIs</a>
<nav class='dropdown'>
<ul>
<li class="dropdown-item"><a href="/releases/latest/javadoc/index.html">Java</a></li>
<li class="dropdown-item"><a href="/releases/latest/dotnetdoc/api/">C#/.NET</a></li>
<li class="dropdown-item"><a href="/releases/latest/cppdoc/index.html">C++</a></li>
<li class="dropdown-item"><a href="/releases/latest/scaladoc/scalar/index.html#org.apache.ignite.scalar.scalar$">Scala</a></li>
</ul>
</nav>
</li>
<li><a href="#">Examples</a>
<nav class="dropdown">
<ul>
<li class="dropdown-item"><a href="https://github.com/apache/ignite/tree/master/examples" target="_blank" rel="noopener" title="Apache Ignite Java examples">Java</a></li>
<li class="dropdown-item"><a href="https://github.com/apache/ignite/tree/master/modules/platforms/dotnet/examples" target="_blank" rel="noopener" title="Apache Ignite C#/.NET examples">C#/.NET</a></li>
<li class="dropdown-item"><a href="https://github.com/apache/ignite/tree/master/modules/platforms/cpp/examples" target="_blank" rel="noopener" title="Apache Ignite C++ examples">C++</a></li>
<li class="dropdown-item"><a href="https://github.com/apache/ignite/tree/master/modules/platforms/python/examples" target="_blank" rel="noopener" title="Apache Ignite Python examples">Python</a></li>
<li class="dropdown-item"><a href="https://github.com/apache/ignite/tree/master/modules/platforms/nodejs/examples" target="_blank" rel="noopener" title="Apache Ignite NodeJS examples">NodeJS</a></li>
<li class="dropdown-item"><a href="https://github.com/apache/ignite/tree/master/modules/platforms/php/examples" target="_blank" rel="noopener" title="Apache Ignite PHP examples">PHP</a></li>
</ul>
</nav>
</li></ul>
</nav>
<form class='search'>
<button class="search-close" type='button'><img src='/assets/images/cancel.svg' alt="close" width="10" height="10" /></button>
<input type="search" placeholder="Search…" id="search-input">
</form>
<nav id="lang-selector"><ul>
<li><a href="#"><img src="/assets/images/icon_lang_en_75x75.jpg" alt="English language icon" width="25" height="25" /><span></span></a>
<nav class="dropdown">
<li class="dropdown-item"><a href="/docs/latest/" ><img src="/assets/images/icon_lang_en_75x75.jpg" alt="English language icon" width="25" height="25" /><span>English</span></a></li>
<li class="dropdown-item"><a href="https://www.ignite-service.cn/doc/java/" target="_blank" rel="noopener"><img src="/assets/images/icon_lang_cn_75x75.jpg" width="25" height="25" alt="Chinese language icon" /><span>Chinese</span></a></li>
</nav>
</li></ul>
</nav>
<button type='button' class='top-nav-toggle'></button>
</div>
</header>
<link rel="stylesheet" href="/assets/css/docs.css">
<section class='page-docs'>
<nav class='left-nav' data-swiftype-index='false'>
<li>
<a href="/docs/latest/index" class='' >Documentation Overview</a>
</li>
<li>
<button type='button' class='group-toggle collapsed '>Quick Start Guides<img class="state-indicator" src="/assets/images/left-nav-arrow.svg" width="6" height="10"></button>
<nav class='nav-group collapsed'>
<li>
<a href="/docs/latest/quick-start/java"
class=''
>Java</a>
</li>
<li>
<a href="/docs/latest/quick-start/dotnet"
class=''
>.NET/C#</a>
</li>
<li>
<a href="/docs/latest/quick-start/cpp"
class=''
>C++</a>
</li>
<li>
<a href="/docs/latest/quick-start/python"
class=''
>Python</a>
</li>
<li>
<a href="/docs/latest/quick-start/nodejs"
class=''
>Node.JS</a>
</li>
<li>
<a href="/docs/latest/quick-start/sql"
class=''
>SQL</a>
</li>
<li>
<a href="/docs/latest/quick-start/php"
class=''
>PHP</a>
</li>
<li>
<a href="/docs/latest/quick-start/restapi"
class=''
>REST API</a>
</li>
</nav>
</li>
<li>
<button type='button' class='group-toggle collapsed '>Installation<img class="state-indicator" src="/assets/images/left-nav-arrow.svg" width="6" height="10"></button>
<nav class='nav-group collapsed'>
<li>
<a href="/docs/latest/installation/installing-using-zip"
class=''
>Installing Using ZIP Archive</a>
</li>
<li>
<a href="/docs/latest/installation/installing-using-docker"
class=''
>Installing Using Docker</a>
</li>
<li>
<a href="/docs/latest/installation/deb-rpm"
class=''
>Installing DEB or RPM package</a>
</li>
<li>
<button
type='button'
class='collapsed '>Kubernetes<img class="state-indicator" src="/assets/images/left-nav-arrow.svg" width="6" height="10"></button>
<nav class="sub_pages collapsed">
<li><a href="/docs/latest/installation/kubernetes/amazon-eks-deployment" class=''>Amazon EKS</a></li>
<li><a href="/docs/latest/installation/kubernetes/azure-deployment" class=''>Azure Kubernetes Service</a></li>
<li><a href="/docs/latest/installation/kubernetes/gke-deployment" class=''>Google Kubernetes Engine</a></li>
</nav>
</li>
<li>
<a href="/docs/latest/installation/vmware-installation"
class=''
>VMWare</a>
</li>
</nav>
</li>
<li>
<button type='button' class='group-toggle collapsed '>Setting Up<img class="state-indicator" src="/assets/images/left-nav-arrow.svg" width="6" height="10"></button>
<nav class='nav-group collapsed'>
<li>
<a href="/docs/latest/understanding-configuration"
class=''
>Understanding Configuration</a>
</li>
<li>
<a href="/docs/latest/setup"
class=''
>Setting Up</a>
</li>
<li>
<a href="/docs/latest/logging"
class=''
>Configuring Logging</a>
</li>
<li>
<a href="/docs/latest/resources-injection"
class=''
>Resources Injection</a>
</li>
</nav>
</li>
<li>
<a href="/docs/latest/starting-nodes" class='' >Starting and Stopping Nodes</a>
</li>
<li>
<button type='button' class='group-toggle collapsed '>Clustering<img class="state-indicator" src="/assets/images/left-nav-arrow.svg" width="6" height="10"></button>
<nav class='nav-group collapsed'>
<li>
<a href="/docs/latest/clustering/clustering"
class=''
>Overview</a>
</li>
<li>
<a href="/docs/latest/clustering/tcp-ip-discovery"
class=''
>TCP/IP Discovery</a>
</li>
<li>
<a href="/docs/latest/clustering/zookeeper-discovery"
class=''
>ZooKeeper Discovery</a>
</li>
<li>
<a href="/docs/latest/clustering/discovery-in-the-cloud"
class=''
>Discovery in the Cloud</a>
</li>
<li>
<a href="/docs/latest/clustering/network-configuration"
class=''
>Network Configuration</a>
</li>
<li>
<a href="/docs/latest/clustering/connect-client-nodes"
class=''
>Connecting Client Nodes</a>
</li>
<li>
<a href="/docs/latest/clustering/baseline-topology"
class=''
>Baseline Topology</a>
</li>
<li>
<a href="/docs/latest/clustering/running-client-nodes-behind-nat"
class=''
>Running Client Nodes Behind NAT</a>
</li>
</nav>
</li>
<li>
<button type='button' class='group-toggle collapsed '>Thin Clients<img class="state-indicator" src="/assets/images/left-nav-arrow.svg" width="6" height="10"></button>
<nav class='nav-group collapsed'>
<li>
<a href="/docs/latest/thin-clients/getting-started-with-thin-clients"
class=''
>Thin Clients Overview</a>
</li>
<li>
<a href="/docs/latest/thin-clients/java-thin-client"
class=''
>Java Thin Client</a>
</li>
<li>
<a href="/docs/latest/thin-clients/dotnet-thin-client"
class=''
>.NET Thin Client</a>
</li>
<li>
<a href="/docs/latest/thin-clients/cpp-thin-client"
class=''
>C++ Thin Client</a>
</li>
<li>
<a href="/docs/latest/thin-clients/python-thin-client"
class=''
>Python Thin Client</a>
</li>
<li>
<a href="/docs/latest/thin-clients/php-thin-client"
class=''
>PHP Thin Client</a>
</li>
<li>
<a href="/docs/latest/thin-clients/nodejs-thin-client"
class=''
>Node.js Thin Client</a>
</li>
<li>
<button
type='button'
class='collapsed '>Binary Client Protocol<img class="state-indicator" src="/assets/images/left-nav-arrow.svg" width="6" height="10"></button>
<nav class="sub_pages collapsed">
<li><a href="/docs/latest/binary-client-protocol/binary-client-protocol" class=''>Binary Client Protocol</a></li>
<li><a href="/docs/latest/binary-client-protocol/data-format" class=''>Data Format</a></li>
<li><a href="/docs/latest/binary-client-protocol/key-value-queries" class=''>Key-Value Queries</a></li>
<li><a href="/docs/latest/binary-client-protocol/sql-and-scan-queries" class=''>SQL and Scan Queries</a></li>
<li><a href="/docs/latest/binary-client-protocol/binary-type-metadata" class=''>Binary Types Metadata</a></li>
<li><a href="/docs/latest/binary-client-protocol/cache-configuration" class=''>Cache Configuration</a></li>
</nav>
</li>
</nav>
</li>
<li>
<button type='button' class='group-toggle collapsed '>Data Modeling<img class="state-indicator" src="/assets/images/left-nav-arrow.svg" width="6" height="10"></button>
<nav class='nav-group collapsed'>
<li>
<a href="/docs/latest/data-modeling/data-modeling"
class=''
>Introduction</a>
</li>
<li>
<a href="/docs/latest/data-modeling/data-partitioning"
class=''
>Data Partitioning</a>
</li>
<li>
<a href="/docs/latest/data-modeling/affinity-collocation"
class=''
>Affinity Colocation</a>
</li>
<li>
<a href="/docs/latest/data-modeling/binary-marshaller"
class=''
>Binary Marshaller</a>
</li>
</nav>
</li>
<li>
<button type='button' class='group-toggle collapsed '>Configuring Memory<img class="state-indicator" src="/assets/images/left-nav-arrow.svg" width="6" height="10"></button>
<nav class='nav-group collapsed'>
<li>
<a href="/docs/latest/memory-architecture"
class=''
>Memory Architecture</a>
</li>
<li>
<a href="/docs/latest/memory-configuration/data-regions"
class=''
>Configuring Data Regions</a>
</li>
<li>
<a href="/docs/latest/memory-configuration/eviction-policies"
class=''
>Eviction Policies</a>
</li>
<li>
<a href="/docs/latest/memory-configuration/replacement-policies"
class=''
>Replacement Policies</a>
</li>
</nav>
</li>
<li>
<button type='button' class='group-toggle collapsed '>Configuring Persistence<img class="state-indicator" src="/assets/images/left-nav-arrow.svg" width="6" height="10"></button>
<nav class='nav-group collapsed'>
<li>
<a href="/docs/latest/persistence/native-persistence"
class=''
>Ignite Persistence</a>
</li>
<li>
<a href="/docs/latest/persistence/external-storage"
class=''
>External Storage</a>
</li>
<li>
<a href="/docs/latest/persistence/swap"
class=''
>Swapping</a>
</li>
<li>
<a href="/docs/latest/persistence/custom-cache-store"
class=''
>Implementing Custom Cache Store</a>
</li>
<li>
<a href="/docs/latest/persistence/snapshot-directory"
class=''
>Configuring Snapshot Directory</a>
</li>
<li>
<a href="/docs/latest/persistence/disk-compression"
class=''
>Disk Compression</a>
</li>
<li>
<a href="/docs/latest/persistence/persistence-tuning"
class=''
>Tuning Persistence</a>
</li>
<li>
<a href="/docs/latest/persistence/change-data-capture"
class=''
>Change Data Capture</a>
</li>
</nav>
</li>
<li>
<a href="/docs/latest/snapshots/snapshots" class='' >Cluster Snapshots</a>
</li>
<li>
<button type='button' class='group-toggle collapsed '>Configuring Caches<img class="state-indicator" src="/assets/images/left-nav-arrow.svg" width="6" height="10"></button>
<nav class='nav-group collapsed'>
<li>
<a href="/docs/latest/configuring-caches/configuration-overview"
class=''
>Cache Configuration</a>
</li>
<li>
<a href="/docs/latest/configuring-caches/configuring-backups"
class=''
>Configuring Partition Backups</a>
</li>
<li>
<a href="/docs/latest/configuring-caches/partition-loss-policy"
class=''
>Partition Loss Policy</a>
</li>
<li>
<a href="/docs/latest/configuring-caches/atomicity-modes"
class=''
>Atomicity Modes</a>
</li>
<li>
<a href="/docs/latest/configuring-caches/expiry-policies"
class=''
>Expiry Policy</a>
</li>
<li>
<a href="/docs/latest/configuring-caches/on-heap-caching"
class=''
>On-Heap Caching</a>
</li>
<li>
<a href="/docs/latest/configuring-caches/cache-groups"
class=''
>Cache Groups</a>
</li>
<li>
<a href="/docs/latest/configuring-caches/near-cache"
class=''
>Near Caches</a>
</li>
</nav>
</li>
<li>
<a href="/docs/latest/data-rebalancing" class='' >Data Rebalancing</a>
</li>
<li>
<a href="/docs/latest/data-streaming" class='' >Data Streaming</a>
</li>
<li>
<button type='button' class='group-toggle collapsed '>Using Key-Value API<img class="state-indicator" src="/assets/images/left-nav-arrow.svg" width="6" height="10"></button>
<nav class='nav-group collapsed'>
<li>
<a href="/docs/latest/key-value-api/basic-cache-operations"
class=''
>Basic Cache Operations</a>
</li>
<li>
<a href="/docs/latest/key-value-api/binary-objects"
class=''
>Working with Binary Objects</a>
</li>
<li>
<a href="/docs/latest/key-value-api/using-cache-queries"
class=''
>Using Cache Queries</a>
</li>
<li>
<a href="/docs/latest/read-repair"
class=''
>Read Repair</a>
</li>
</nav>
</li>
<li>
<a href="/docs/latest/key-value-api/transactions" class='' >Performing Transactions</a>
</li>
<li>
<button type='button' class='group-toggle collapsed '>Working with SQL<img class="state-indicator" src="/assets/images/left-nav-arrow.svg" width="6" height="10"></button>
<nav class='nav-group collapsed'>
<li>
<a href="/docs/latest/SQL/sql-introduction"
class=''
>Introduction</a>
</li>
<li>
<a href="/docs/latest/SQL/schemas"
class=''
>Understanding Schemas</a>
</li>
<li>
<a href="/docs/latest/SQL/indexes"
class=''
>Defining Indexes</a>
</li>
<li>
<a href="/docs/latest/SQL/sql-api"
class=''
>Using SQL API</a>
</li>
<li>
<a href="/docs/latest/SQL/distributed-joins"
class=''
>Distributed Joins</a>
</li>
<li>
<a href="/docs/latest/SQL/custom-sql-func"
class=''
>Custom SQL Functions</a>
</li>
<li>
<a href="/docs/latest/SQL/JDBC/jdbc-driver"
class=''
>JDBC Driver</a>
</li>
<li>
<a href="/docs/latest/SQL/JDBC/jdbc-client-driver"
class=''
>JDBC Client Driver</a>
</li>
<li>
<button
type='button'
class='collapsed '>ODBC Driver<img class="state-indicator" src="/assets/images/left-nav-arrow.svg" width="6" height="10"></button>
<nav class="sub_pages collapsed">
<li><a href="/docs/latest/SQL/ODBC/odbc-driver" class=''>ODBC Driver</a></li>
<li><a href="/docs/latest//SQL/ODBC/connection-string-dsn" class=''>Connection String and DSN</a></li>
<li><a href="/docs/latest/SQL/ODBC/querying-modifying-data" class=''>Querying and Modifying Data</a></li>
<li><a href="/docs/latest/SQL/ODBC/specification" class=''>Specification</a></li>
<li><a href="/docs/latest/SQL/ODBC/data-types" class=''>Data Types</a></li>
<li><a href="/docs/latest/SQL/ODBC/error-codes" class=''>Error Codes</a></li>
</nav>
</li>
<li>
<a href="/docs/latest/transactions/mvcc"
class=''
>Multiversion Concurrency Control</a>
</li>
<li>
<a href="/docs/latest/SQL/sql-statistics"
class=''
>SQL Statistics</a>
</li>
<li>
<a href="/docs/latest/SQL/sql-calcite"
class=''
>Calcite-based SQL Engine</a>
</li>
</nav>
</li>
<li>
<button type='button' class='group-toggle expanded '>SQL Reference<img class="state-indicator" src="/assets/images/left-nav-arrow.svg" width="6" height="10"></button>
<nav class='nav-group expanded'>
<li>
<a href="/docs/latest/sql-reference/sql-conformance"
class=''
>SQL Conformance</a>
</li>
<li>
<a href="/docs/latest/sql-reference/ddl"
class='active'
>Data Definition Language (DDL)</a>
</li>
<li>
<a href="/docs/latest/sql-reference/dml"
class=''
>Data Manipulation Language (DML)</a>
</li>
<li>
<a href="/docs/latest/sql-reference/transactions"
class=''
>Transactions</a>
</li>
<li>
<a href="/docs/latest/sql-reference/operational-commands"
class=''
>Operational Commands</a>
</li>
<li>
<a href="/docs/latest/sql-reference/aggregate-functions"
class=''
>Aggregate functions</a>
</li>
<li>
<a href="/docs/latest/sql-reference/numeric-functions"
class=''
>Numeric Functions</a>
</li>
<li>
<a href="/docs/latest/sql-reference/string-functions"
class=''
>String Functions</a>
</li>
<li>
<a href="/docs/latest/sql-reference/date-time-functions"
class=''
>Data and Time Functions</a>
</li>
<li>
<a href="/docs/latest/sql-reference/system-functions"
class=''
>System Functions</a>
</li>
<li>
<a href="/docs/latest/sql-reference/data-types"
class=''
>Data Types</a>
</li>
</nav>
</li>
<li>
<button type='button' class='group-toggle collapsed '>Distributed Computing<img class="state-indicator" src="/assets/images/left-nav-arrow.svg" width="6" height="10"></button>
<nav class='nav-group collapsed'>
<li>
<a href="/docs/latest/distributed-computing/distributed-computing"
class=''
>Distributed Computing API</a>
</li>
<li>
<a href="/docs/latest/distributed-computing/cluster-groups"
class=''
>Cluster Groups</a>
</li>
<li>
<a href="/docs/latest/distributed-computing/executor-service"
class=''
>Executor Service</a>
</li>
<li>
<a href="/docs/latest/distributed-computing/map-reduce"
class=''
>MapReduce API</a>
</li>
<li>
<a href="/docs/latest/distributed-computing/load-balancing"
class=''
>Load Balancing</a>
</li>
<li>
<a href="/docs/latest/distributed-computing/fault-tolerance"
class=''
>Fault Tolerance</a>
</li>
<li>
<a href="/docs/latest/distributed-computing/job-scheduling"
class=''
>Job Scheduling</a>
</li>
<li>
<a href="/docs/latest/distributed-computing/collocated-computations"
class=''
>Colocating Computations with Data</a>
</li>
</nav>
</li>
<li>
<button type='button' class='group-toggle collapsed '>Code Deployment<img class="state-indicator" src="/assets/images/left-nav-arrow.svg" width="6" height="10"></button>
<nav class='nav-group collapsed'>
<li>
<a href="/docs/latest/code-deployment/deploying-user-code"
class=''
>Deploying User Code</a>
</li>
<li>
<a href="/docs/latest/code-deployment/peer-class-loading"
class=''
>Peer Class Loading</a>
</li>
</nav>
</li>
<li>
<button type='button' class='group-toggle collapsed '>Machine Learning<img class="state-indicator" src="/assets/images/left-nav-arrow.svg" width="6" height="10"></button>
<nav class='nav-group collapsed'>
<li>
<a href="/docs/latest/machine-learning/machine-learning"
class=''
>Machine Learning</a>
</li>
<li>
<a href="/docs/latest/machine-learning/partition-based-dataset"
class=''
>Partition Based Dataset</a>
</li>
<li>
<a href="/docs/latest/machine-learning/updating-trained-models"
class=''
>Updating Trained Models</a>
</li>
<li>
<button
type='button'
class='collapsed '>Binary Classification<img class="state-indicator" src="/assets/images/left-nav-arrow.svg" width="6" height="10"></button>
<nav class="sub_pages collapsed">
<li><a href="/docs/latest/machine-learning/binary-classification/introduction" class=''>Introduction</a></li>
<li><a href="/docs/latest/machine-learning/binary-classification/linear-svm" class=''>Linear SVM (Support Vector Machine)</a></li>
<li><a href="/docs/latest/machine-learning/binary-classification/decision-trees" class=''>Decision Trees</a></li>
<li><a href="/docs/latest/machine-learning/binary-classification/multilayer-perceptron" class=''>Multilayer Perceptron</a></li>
<li><a href="/docs/latest/machine-learning/binary-classification/logistic-regression" class=''>Logistic Regression</a></li>
<li><a href="/docs/latest/machine-learning/binary-classification/knn-classification" class=''>k-NN Classification</a></li>
<li><a href="/docs/latest/machine-learning/binary-classification/ann" class=''>ANN (Approximate Nearest Neighbor)</a></li>
<li><a href="/docs/latest/machine-learning/binary-classification/naive-bayes" class=''>Naive Bayes</a></li>
</nav>
</li>
<li>
<button
type='button'
class='collapsed '>Regression<img class="state-indicator" src="/assets/images/left-nav-arrow.svg" width="6" height="10"></button>
<nav class="sub_pages collapsed">
<li><a href="/docs/latest/machine-learning/regression/introduction" class=''>Introduction</a></li>
<li><a href="/docs/latest/machine-learning/regression/linear-regression" class=''>Linear Regression</a></li>
<li><a href="/docs/latest/machine-learning/regression/decision-trees-regression" class=''>Decision Trees Regression</a></li>
<li><a href="/docs/latest/machine-learning/regression/knn-regression" class=''>k-NN Regression</a></li>
</nav>
</li>
<li>
<button
type='button'
class='collapsed '>Clustering<img class="state-indicator" src="/assets/images/left-nav-arrow.svg" width="6" height="10"></button>
<nav class="sub_pages collapsed">
<li><a href="/docs/latest/machine-learning/clustering/introduction" class=''>Introduction</a></li>
<li><a href="/docs/latest/machine-learning/clustering/k-means-clustering" class=''>K-Means Clustering</a></li>
<li><a href="/docs/latest/machine-learning/clustering/gaussian-mixture" class=''>Gaussian mixture (GMM)</a></li>
</nav>
</li>
<li>
<a href="/docs/latest/machine-learning/preprocessing"
class=''
>Preprocessing</a>
</li>
<li>
<button
type='button'
class='collapsed '>Model Selection<img class="state-indicator" src="/assets/images/left-nav-arrow.svg" width="6" height="10"></button>
<nav class="sub_pages collapsed">
<li><a href="/docs/latest/machine-learning/model-selection/introduction" class=''>Introduction</a></li>
<li><a href="/docs/latest/machine-learning/model-selection/evaluator" class=''>Evaluator</a></li>
<li><a href="/docs/latest/machine-learning/model-selection/split-the-dataset-on-test-and-train-datasets" class=''>Split the dataset on test and train datasets</a></li>
<li><a href="/docs/latest/machine-learning/model-selection/hyper-parameter-tuning" class=''>Hyper-parameter tuning</a></li>
<li><a href="/docs/latest/machine-learning/model-selection/pipeline-api" class=''>Pipeline API</a></li>
</nav>
</li>
<li>
<a href="/docs/latest/machine-learning/multiclass-classification"
class=''
>Multiclass Classification</a>
</li>
<li>
<button
type='button'
class='collapsed '>Ensemble Methods<img class="state-indicator" src="/assets/images/left-nav-arrow.svg" width="6" height="10"></button>
<nav class="sub_pages collapsed">
<li><a href="/docs/latest/machine-learning/ensemble-methods/introduction" class=''></a></li>
<li><a href="/docs/latest/machine-learning/ensemble-methods/stacking" class=''>Stacking</a></li>
<li><a href="/docs/latest/machine-learning/ensemble-methods/baggin" class=''>Bagging</a></li>
<li><a href="/docs/latest/machine-learning/ensemble-methods/random-forest" class=''>Random Forest</a></li>
<li><a href="/docs/latest/machine-learning/ensemble-methods/gradient-boosting" class=''>Gradient Boosting</a></li>
</nav>
</li>
<li>
<a href="/docs/latest/machine-learning/recommendation-systems"
class=''
>Recommendation Systems</a>
</li>
<li>
<button
type='button'
class='collapsed '>Importing Model<img class="state-indicator" src="/assets/images/left-nav-arrow.svg" width="6" height="10"></button>
<nav class="sub_pages collapsed">
<li><a href="/docs/latest/machine-learning/importing-model/introduction" class=''>Introduction</a></li>
<li><a href="/docs/latest/machine-learning/importing-model/model-import-from-gxboost" class=''>Import Model from XGBoost</a></li>
<li><a href="/docs/latest/machine-learning/importing-model/model-import-from-apache-spark" class=''>Import Model from Apache Spark</a></li>
</nav>
</li>
</nav>
</li>
<li>
<a href="/docs/latest/key-value-api/continuous-queries" class='' >Using Continuous Queries</a>
</li>
<li>
<a href="/docs/latest/services/services" class='' >Using Ignite Services</a>
</li>
<li>
<a href="/docs/latest/messaging" class='' >Using Ignite Messaging</a>
</li>
<li>
<button type='button' class='group-toggle collapsed '>Distributed Data Structures<img class="state-indicator" src="/assets/images/left-nav-arrow.svg" width="6" height="10"></button>
<nav class='nav-group collapsed'>
<li>
<a href="/docs/latest/data-structures/queue-and-set"
class=''
>Queue and Set</a>
</li>
<li>
<a href="/docs/latest/data-structures/atomic-types"
class=''
>Atomic Types</a>
</li>
<li>
<a href="/docs/latest/data-structures/countdownlatch"
class=''
>CountDownLatch</a>
</li>
<li>
<a href="/docs/latest/data-structures/atomic-sequence"
class=''
>Atomic Sequence</a>
</li>
<li>
<a href="/docs/latest/data-structures/semaphore"
class=''
>Semaphore</a>
</li>
<li>
<a href="/docs/latest/data-structures/id-generator"
class=''
>ID Generator</a>
</li>
</nav>
</li>
<li>
<a href="/docs/latest/distributed-locks" class='' >Distributed Locks</a>
</li>
<li>
<a href="/docs/latest/restapi" class='' >REST API</a>
</li>
<li>
<button type='button' class='group-toggle collapsed '>.NET Specific<img class="state-indicator" src="/assets/images/left-nav-arrow.svg" width="6" height="10"></button>
<nav class='nav-group collapsed'>
<li>
<a href="/docs/latest/net-specific/net-configuration-options"
class=''
>Configuration Options</a>
</li>
<li>
<a href="/docs/latest/net-specific/net-deployment-options"
class=''
>Deployment Options</a>
</li>
<li>
<a href="/docs/latest/net-specific/net-standalone-nodes"
class=''
>Standalone Nodes</a>
</li>
<li>
<a href="/docs/latest/net-specific/net-async"
class=''
>Asynchronous APIs</a>
</li>
<li>
<a href="/docs/latest/net-specific/net-logging"
class=''
>Logging</a>
</li>
<li>
<a href="/docs/latest/net-specific/net-linq"
class=''
>LINQ</a>
</li>
<li>
<a href="/docs/latest/net-specific/net-java-services-execution"
class=''
>Java Services Execution</a>
</li>
<li>
<a href="/docs/latest/net-specific/net-platform-cache"
class=''
>.NET Platform Cache</a>
</li>
<li>
<a href="/docs/latest/net-specific/net-plugins"
class=''
>Plugins</a>
</li>
<li>
<a href="/docs/latest/net-specific/net-serialization"
class=''
>Serialization</a>
</li>
<li>
<a href="/docs/latest/net-specific/net-cross-platform-support"
class=''
>Cross-Platform Support</a>
</li>
<li>
<a href="/docs/latest/net-specific/net-platform-interoperability"
class=''
>Platform Interoperability</a>
</li>
<li>
<a href="/docs/latest/net-specific/net-remote-assembly-loading"
class=''
>Remote Assembly Loading</a>
</li>
<li>
<a href="/docs/latest/net-specific/net-troubleshooting"
class=''
>Troubleshooting</a>
</li>
<li>
<button
type='button'
class='collapsed '>Integrations<img class="state-indicator" src="/assets/images/left-nav-arrow.svg" width="6" height="10"></button>
<nav class="sub_pages collapsed">
<li><a href="/docs/latest/net-specific/asp-net-output-caching" class=''>ASP.NET Output Caching</a></li>
<li><a href="/docs/latest/net-specific/asp-net-session-state-caching" class=''>ASP.NET Session State Caching</a></li>
<li><a href="/docs/latest/net-specific/net-entity-framework-cache" class=''>Entity Framework 2nd Level Cache</a></li>
</nav>
</li>
</nav>
</li>
<li>
<button type='button' class='group-toggle collapsed '>C++ Specific<img class="state-indicator" src="/assets/images/left-nav-arrow.svg" width="6" height="10"></button>
<nav class='nav-group collapsed'>
<li>
<a href="/docs/latest/cpp-specific/cpp-serialization"
class=''
>Serialization</a>
</li>
<li>
<a href="/docs/latest/cpp-specific/cpp-platform-interoperability"
class=''
>Platform Interoperability</a>
</li>
<li>
<a href="/docs/latest/cpp-specific/cpp-objects-lifetime"
class=''
>Objects Lifetime</a>
</li>
</nav>
</li>
<li>
<button type='button' class='group-toggle collapsed '>Monitoring<img class="state-indicator" src="/assets/images/left-nav-arrow.svg" width="6" height="10"></button>
<nav class='nav-group collapsed'>
<li>
<a href="/docs/latest/monitoring-metrics/intro"
class=''
>Introduction</a>
</li>
<li>
<a href="/docs/latest/monitoring-metrics/cluster-id"
class=''
>Cluster ID and Tag</a>
</li>
<li>
<a href="/docs/latest/monitoring-metrics/cluster-states"
class=''
>Cluster States</a>
</li>
<li>
<button
type='button'
class='collapsed '>Metrics<img class="state-indicator" src="/assets/images/left-nav-arrow.svg" width="6" height="10"></button>
<nav class="sub_pages collapsed">
<li><a href="/docs/latest/monitoring-metrics/configuring-metrics" class=''>Configuring Metrics</a></li>
<li><a href="/docs/latest/monitoring-metrics/metrics" class=''>JMX Metrics</a></li>
</nav>
</li>
<li>
<button
type='button'
class='collapsed '>New Metrics System<img class="state-indicator" src="/assets/images/left-nav-arrow.svg" width="6" height="10"></button>
<nav class="sub_pages collapsed">
<li><a href="/docs/latest/monitoring-metrics/new-metrics-system" class=''>Introduction</a></li>
<li><a href="/docs/latest/monitoring-metrics/new-metrics" class=''>Metrics</a></li>
</nav>
</li>
<li>
<a href="/docs/latest/monitoring-metrics/system-views"
class=''
>System Views</a>
</li>
<li>
<a href="/docs/latest/monitoring-metrics/performance-statistics"
class=''
>Performance Statistics</a>
</li>
<li>
<a href="/docs/latest/monitoring-metrics/tracing"
class=''
>Tracing</a>
</li>
</nav>
</li>
<li>
<button type='button' class='group-toggle collapsed '>Working with Events<img class="state-indicator" src="/assets/images/left-nav-arrow.svg" width="6" height="10"></button>
<nav class='nav-group collapsed'>
<li>
<a href="/docs/latest/events/listening-to-events"
class=''
>Enabling and Listenting to Events</a>
</li>
<li>
<a href="/docs/latest/events/events"
class=''
>Events</a>
</li>
</nav>
</li>
<li>
<button type='button' class='group-toggle collapsed '>Tools<img class="state-indicator" src="/assets/images/left-nav-arrow.svg" width="6" height="10"></button>
<nav class='nav-group collapsed'>
<li>
<a href="/docs/latest/tools/control-script"
class=''
>Control Script</a>
</li>
<li>
<a href="/docs/latest/tools/visor-cmd"
class=''
>Visor CMD</a>
</li>
<li>
<a href="/docs/latest/tools/gg-control-center"
class=''
>GridGain Control Center</a>
</li>
<li>
<a href="/docs/latest/tools/sqlline"
class=''
>SQLLine</a>
</li>
<li>
<a href="/docs/latest/tools/tableau"
class=''
>Tableau</a>
</li>
<li>
<a href="/docs/latest/tools/informatica"
class=''
>Informatica</a>
</li>
<li>
<a href="/docs/latest/tools/pentaho"
class=''
>Pentaho</a>
</li>
</nav>
</li>
<li>
<button type='button' class='group-toggle collapsed '>Security<img class="state-indicator" src="/assets/images/left-nav-arrow.svg" width="6" height="10"></button>
<nav class='nav-group collapsed'>
<li>
<a href="/docs/latest/security/authentication"
class=''
>Authentication</a>
</li>
<li>
<a href="/docs/latest/security/ssl-tls"
class=''
>SSL/TLS</a>
</li>
<li>
<button
type='button'
class='collapsed '>Transparent Data Encryption<img class="state-indicator" src="/assets/images/left-nav-arrow.svg" width="6" height="10"></button>
<nav class="sub_pages collapsed">
<li><a href="/docs/latest/security/tde" class=''>Introduction</a></li>
<li><a href="/docs/latest/security/master-key-rotation" class=''>Master key rotation</a></li>
<li><a href="/docs/latest/security/cache-encryption-key-rotation" class=''>Cache encryption key rotation</a></li>
</nav>
</li>
<li>
<a href="/docs/latest/security/sandbox"
class=''
>Sandbox</a>
</li>
</nav>
</li>
<li>
<button type='button' class='group-toggle collapsed '>Extensions and Integrations<img class="state-indicator" src="/assets/images/left-nav-arrow.svg" width="6" height="10"></button>
<nav class='nav-group collapsed'>
<li>
<button
type='button'
class='collapsed '>Spring<img class="state-indicator" src="/assets/images/left-nav-arrow.svg" width="6" height="10"></button>
<nav class="sub_pages collapsed">
<li><a href="/docs/latest/extensions-and-integrations/spring/spring-boot" class=''>Spring Boot</a></li>
<li><a href="/docs/latest/extensions-and-integrations/spring/spring-data" class=''>Spring Data</a></li>
<li><a href="/docs/latest/extensions-and-integrations/spring/spring-caching" class=''>Spring Caching</a></li>
<li><a href="/docs/latest/extensions-and-integrations/spring/spring-tx" class=''>Spring Transactions</a></li>
</nav>
</li>
<li>
<button
type='button'
class='collapsed '>Ignite for Spark<img class="state-indicator" src="/assets/images/left-nav-arrow.svg" width="6" height="10"></button>
<nav class="sub_pages collapsed">
<li><a href="/docs/latest/extensions-and-integrations/ignite-for-spark/overview" class=''>Overview</a></li>
<li><a href="/docs/latest/extensions-and-integrations/ignite-for-spark/ignitecontext-and-rdd" class=''>IgniteContext and IgniteRDD</a></li>
<li><a href="/docs/latest/extensions-and-integrations/ignite-for-spark/ignite-dataframe" class=''>Ignite DataFrame</a></li>
<li><a href="/docs/latest/extensions-and-integrations/ignite-for-spark/installation" class=''>Installation</a></li>
<li><a href="/docs/latest/extensions-and-integrations/ignite-for-spark/spark-shell" class=''>Test Ignite with Spark-shell</a></li>
<li><a href="/docs/latest/extensions-and-integrations/ignite-for-spark/troubleshooting" class=''>Troubleshooting</a></li>
</nav>
</li>
<li>
<a href="/docs/latest/extensions-and-integrations/hibernate-l2-cache"
class=''
>Hibernate L2 Cache</a>
</li>
<li>
<a href="/docs/latest/extensions-and-integrations/mybatis-l2-cache"
class=''
>MyBatis L2 Cache</a>
</li>
<li>
<button
type='button'
class='collapsed '>Streaming<img class="state-indicator" src="/assets/images/left-nav-arrow.svg" width="6" height="10"></button>
<nav class="sub_pages collapsed">
<li><a href="/docs/latest/extensions-and-integrations/streaming/kafka-streamer" class=''>Kafka Streamer</a></li>
<li><a href="/docs/latest/extensions-and-integrations/streaming/camel-streamer" class=''>Camel Streamer</a></li>
<li><a href="/docs/latest/extensions-and-integrations/streaming/flink-streamer" class=''>Flink Streamer</a></li>
<li><a href="/docs/latest/extensions-and-integrations/streaming/flume-sink" class=''>Flume Sink</a></li>
<li><a href="/docs/latest/extensions-and-integrations/streaming/jms-streamer" class=''>JMS Streamer</a></li>
<li><a href="/docs/latest/extensions-and-integrations/streaming/mqtt-streamer" class=''>MQTT Streamer</a></li>
<li><a href="/docs/latest/extensions-and-integrations/streaming/rocketmq-streamer" class=''>RocketMQ Streamer</a></li>
<li><a href="/docs/latest/extensions-and-integrations/streaming/storm-streamer" class=''>Storm Streamer</a></li>
<li><a href="/docs/latest/extensions-and-integrations/streaming/zeromq-streamer" class=''>ZeroMQ Streamer</a></li>
<li><a href="/docs/latest/extensions-and-integrations/streaming/twitter-streamer" class=''>Twitter Streamer</a></li>
</nav>
</li>
<li>
<button
type='button'
class='collapsed '>Cassandra Integration<img class="state-indicator" src="/assets/images/left-nav-arrow.svg" width="6" height="10"></button>
<nav class="sub_pages collapsed">
<li><a href="/docs/latest/extensions-and-integrations/cassandra/overview" class=''>Overview</a></li>
<li><a href="/docs/latest/extensions-and-integrations/cassandra/configuration" class=''>Configuration</a></li>
<li><a href="/docs/latest/extensions-and-integrations/cassandra/usage-examples" class=''>Usage Examples</a></li>
<li><a href="/docs/latest/extensions-and-integrations/cassandra/ddl-generator" class=''>DDL Generator</a></li>
</nav>
</li>
<li>
<a href="/docs/latest/extensions-and-integrations/php-pdo"
class=''
>PHP PDO</a>
</li>
<li>
<a href="/docs/latest/extensions-and-integrations/performance-statistics"
class=''
>Performance Statistics</a>
</li>
<li>
<a href="/docs/latest/extensions-and-integrations/change-data-capture-extensions"
class=''
>Change Data Capture</a>
</li>
<li>
<a href="/docs/latest/extensions-and-integrations/zookeeper-ip-finder-ext"
class=''
>ZooKeeper IP Finder</a>
</li>
</nav>
</li>
<li>
<a href="/docs/latest/plugins" class='' >Plugins</a>
</li>
<li>
<button type='button' class='group-toggle collapsed '>Performance and Troubleshooting<img class="state-indicator" src="/assets/images/left-nav-arrow.svg" width="6" height="10"></button>
<nav class='nav-group collapsed'>
<li>
<a href="/docs/latest/perf-and-troubleshooting/general-perf-tips"
class=''
>General Performance Tips</a>
</li>
<li>
<a href="/docs/latest/perf-and-troubleshooting/memory-tuning"
class=''
>Memory and JVM Tuning</a>
</li>
<li>
<a href="/docs/latest/perf-and-troubleshooting/persistence-tuning"
class=''
>Persistence Tuning</a>
</li>
<li>
<a href="/docs/latest/perf-and-troubleshooting/sql-tuning"
class=''
>SQL Tuning</a>
</li>
<li>
<a href="/docs/latest/perf-and-troubleshooting/thread-pools-tuning"
class=''
>Thread Pools Tuning</a>
</li>
<li>
<a href="/docs/latest/perf-and-troubleshooting/troubleshooting"
class=''
>Troubleshooting and Debugging</a>
</li>
<li>
<a href="/docs/latest/perf-and-troubleshooting/handling-exceptions"
class=''
>Handling Exceptions</a>
</li>
<li>
<a href="/docs/latest/perf-and-troubleshooting/yardstick-benchmarking"
class=''
>Benchmarking With Yardstick</a>
</li>
</nav>
</li>
</nav>
<div class="left-nav__overlay"></div>
<article data-swiftype-index='true'>
<a class='edit-link' href="https://github.com/apache/ignite/tree/IGNITE-7595/docs/_docs/sql-reference/ddl.adoc" target="_blank">Edit</a>
<h1>Ddl</h1>
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>This page encompasses all data definition language (DDL) commands supported by Ignite.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="create-table">CREATE TABLE</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The command creates a new Ignite cache and defines a SQL table on top of it. The underlying cache stores the data in
the form of key-value pairs while the table allows processing the data with SQL queries.</p>
</div>
<div class="paragraph">
<p>The table will reside in the <a href="/docs/latest/SQL/schemas">Schema</a> specified in the connection parameters. If no schema is specified,
the <code>PUBLIC</code> will be used as a default.</p>
</div>
<div class="paragraph">
<p>The <code>CREATE TABLE</code> command is synchronous. Moreover, it blocks the execution of other DDL commands that are issued before the
<code>CREATE TABLE</code> command has finished execution. The execution of DML commands is not affected and can be performed in parallel.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sql"><span class="k">CREATE</span> <span class="k">TABLE</span> <span class="p">[</span><span class="n">IF</span> <span class="k">NOT</span> <span class="k">EXISTS</span><span class="p">]</span> <span class="n">tableName</span> <span class="p">(</span><span class="n">tableColumn</span> <span class="p">[,</span> <span class="n">tableColumn</span><span class="p">]...</span>
<span class="p">[,</span> <span class="k">PRIMARY</span> <span class="k">KEY</span> <span class="p">(</span><span class="n">columnName</span> <span class="p">[,</span><span class="n">columnName</span><span class="p">]...)])</span>
<span class="p">[</span><span class="k">WITH</span> <span class="nv">"paramName=paramValue [,paramName=paramValue]..."</span><span class="p">]</span>
<span class="n">tableColumn</span> <span class="p">:</span><span class="o">=</span> <span class="n">columnName</span> <span class="n">columnType</span> <span class="p">[</span><span class="k">DEFAULT</span> <span class="n">defaultValue</span><span class="p">]</span> <span class="p">[</span><span class="k">PRIMARY</span> <span class="k">KEY</span><span class="p">]</span></code></pre>
</div>
</div>
<div class="paragraph">
<p>Parameters:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><code>tableName</code> - name of the table.</p>
</li>
<li>
<p><code>tableColumn</code> - name and type of a column to be created in the new table.</p>
</li>
<li>
<p><code>columnName</code> - name of a previously defined column.</p>
</li>
<li>
<p><code>DEFAULT</code> - specifies a default value for the column. Only constant values are accepted.</p>
</li>
<li>
<p><code>IF NOT EXISTS</code> - create the table only if a table with the same name does not exist.</p>
</li>
<li>
<p><code>PRIMARY KEY</code> - specifies a primary key for the table that can consist of a single column or multiple columns.</p>
</li>
<li>
<p><code>WITH</code> - accepts additional parameters not defined by ANSI-99 SQL:</p>
<div class="ulist">
<ul>
<li>
<p><code>TEMPLATE=&lt;cache&#8217;s template name&gt;</code> - case-sensitive​ name of a <a href="/docs/latest/configuring-caches/configuration-overview#cache-templates">cache template</a>. A template is an instance of the <code>CacheConfiguration</code> class registered by calling <code>Ignite.addCacheConfiguration()</code>. Use predefined <code>TEMPLATE=PARTITIONED</code> or <code>TEMPLATE=REPLICATED</code> templates to create the cache with the corresponding replication mode. The rest of the parameters will be those that are defined in the <code>CacheConfiguration</code> object. By default, <code>TEMPLATE=PARTITIONED</code> is used if the template is not specified explicitly.</p>
</li>
<li>
<p><code>BACKUPS=&lt;number of backups&gt;</code> - sets the number of <a href="/docs/latest/configuring-caches/configuring-backups">partition backups</a>. If neither this nor the <code>TEMPLATE</code> parameter is set, then the cache is created with <code>0</code> backup copies.</p>
</li>
<li>
<p><code>ATOMICITY=&lt;ATOMIC | TRANSACTIONAL | TRANSACTIONAL_SNAPSHOT&gt;</code> - sets <a href="/docs/latest/key-value-api/transactions">atomicity mode</a> for the underlying cache. If neither this nor the <code>TEMPLATE</code> parameter is set, then the cache is created with the <code>ATOMIC</code> mode enabled. If <code>TRANSACTIONAL_SNAPSHOT</code> is specified, the table will <a href="/docs/latest/transactions/mvcc">support transactions</a>.</p>
</li>
<li>
<p><code>WRITE_SYNCHRONIZATION_MODE=&lt;PRIMARY_SYNC | FULL_SYNC | FULL_ASYNC&gt;</code> -
sets the write synchronization mode for the underlying cache. If neither this nor the <code>TEMPLATE</code> parameter is set, then the cache is created with <code>FULL_SYNC</code> mode enabled.</p>
</li>
<li>
<p><code>CACHE_GROUP=&lt;group name&gt;</code> - specifies the <a href="/docs/latest/configuring-caches/cache-groups">group name</a> the underlying cache belongs to.</p>
</li>
<li>
<p><code>AFFINITY_KEY=&lt;affinity key column name&gt;</code> - specifies an <a href="/docs/latest/data-modeling/affinity-collocation">affinity key</a> name which is a column of the <code>PRIMARY KEY</code> constraint.</p>
</li>
<li>
<p><code>CACHE_NAME=&lt;custom name of the new cache&gt;</code> - the name of the underlying cache created by the command,
or the <code>SQL_{SCHEMA_NAME}_{TABLE}</code> format will be used if the parameter not specified.</p>
</li>
<li>
<p><code>DATA_REGION=&lt;existing data region name&gt;</code> - name of the <a href="/docs/latest/memory-configuration/data-regions">data region</a> where table entries should be stored. By default, Ignite stores all the data in a default region.</p>
</li>
<li>
<p><code>KEY_TYPE=&lt;custom name of the key type&gt;</code> - sets the name of the custom key type that is used from the key-value APIs in Ignite. The name should correspond to a Java, .NET, or C++ class, or it can be a random one if <a href="/docs/latest/data-modeling/data-modeling#binary-object-format">BinaryObjects</a> is used instead of a custom class. The number of fields and their types in the custom key type has to correspond to the <code>PRIMARY KEY</code>. Refer to the <a href="#Description">[Description]</a> section below for more details.</p>
</li>
<li>
<p><code>VALUE_TYPE=&lt;custom name of the value type of the new cache&gt;</code> - sets the name of a custom value type that is used from the key-value and other non-SQL APIs in Ignite. The name should correspond to a Java, .NET, or C++ class, or it can be a random one if
<a href="/docs/latest/data-modeling/data-modeling#binary-object-format">BinaryObjects</a> is used instead of a custom class. The value type should include all the columns defined in the CREATE TABLE command except for those listed in the <code>PRIMARY KEY</code> constraint. Refer to the <a href="#Description">[Description]</a> section below for more details.</p>
</li>
<li>
<p><code>WRAP_KEY=&lt;true | false&gt;</code> - this flag controls whether a <em>single column</em> <code>PRIMARY KEY</code> should be wrapped in the <a href="/docs/latest/data-modeling/data-modeling#binary-object-format">BinaryObjects</a> format or not. By default, this flag is set to false. This flag does not have any effect on the <code>PRIMARY KEY</code> with multiple columns; it always gets wrapped regardless of the value of the parameter.</p>
</li>
<li>
<p><code>WRAP_VALUE=&lt;true | false&gt;</code> - this flag controls whether a single column value of a primitive type should be wrapped in the <a href="/docs/latest/data-modeling/data-modeling#binary-object-format">BinaryObjects</a> format or not. By default, this flag is set to true. This flag does not have any effect on the value with multiple columns; it always gets wrapped regardless of the value of the parameter. Set this parameter to false if you have a single column value and do not plan to add additional columns to the table. Note that once the parameter is set to false, you can&#8217;t use the <code>ALTER TABLE ADD COLUMN</code> command for this specific table.</p>
</li>
</ul>
</div>
</li>
</ul>
</div>
<div class="paragraph">
<p>Read more about the database architecture on the <a href="/docs/latest/SQL/sql-introduction">SQL Introduction</a> page.</p>
</div>
<div class="sect2">
<h3 id="define-primary-key">Define Primary Key</h3>
<div class="paragraph">
<p>The example below shows how to create a table with <code>PRIMARY KEY</code> specified in the column definition and override cache
related parameters. A new distributed cache <code>SQL_PUBLIC_PERSON</code> will be created (the <code>SQL_{SCHEMA_NAME}_{TABLE}</code> format
is used for naming) which stores objects of the <code>Person</code> type that corresponds to a specific Java, .NET, C++ class or BinaryObject.</p>
</div>
<div class="paragraph">
<p>The distributed cache related parameters are passed in the <code>WITH</code> clause of the statement. If the <code>WITH</code> clause is omitted,
then the cache will be created with default parameters set in the <code>CacheConfiguration</code> object.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sql"><span class="k">CREATE</span> <span class="k">TABLE</span> <span class="n">Person</span> <span class="p">(</span>
<span class="n">id</span> <span class="nb">int</span> <span class="k">PRIMARY</span> <span class="k">KEY</span><span class="p">,</span>
<span class="n">city_id</span> <span class="nb">int</span><span class="p">,</span>
<span class="n">name</span> <span class="nb">varchar</span><span class="p">,</span>
<span class="n">age</span> <span class="nb">int</span><span class="p">,</span>
<span class="n">company</span> <span class="nb">varchar</span>
<span class="p">)</span> <span class="k">WITH</span> <span class="nv">"atomicity=transactional,cachegroup=somegroup"</span><span class="p">;</span></code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="use-non-sql-api">Use non-SQL API</h3>
<div class="paragraph">
<p>If you wish to access the table data by the key-value or other non-SQL API, then you might be need to set the <code>CACHE_NAME</code> and
<code>KEY_TYPE</code>, <code>VALUE_TYPE</code> parameters corresponding to your business model objects to make non-SQL APIs usage more convenient.</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Use the <code>CACHE_NAME</code> parameter to override the default name with the following format <code>SQL_{SCHEMA_NAME}_{TABLE}</code>.</p>
</li>
<li>
<p>By default, the command also creates two new binary types - for the key and value respectively. Ignite in turn generates
the names of the types randomly including a UUID string which complicates the usage of these types from a non-SQL API.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>The example below shows how to create a table <code>PERSON</code> and the underlying cache with the same name. The cache will store objects
of the <code>Person</code> type with explicitly defined the key type <code>PersonKey</code> and value type <code>PersonValue</code>. The <code>PRIMARY KEY</code> columns will
be used as the object&#8217;s key, the rest of the columns will belong to the value.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sql"><span class="k">CREATE</span> <span class="k">TABLE</span> <span class="n">IF</span> <span class="k">NOT</span> <span class="k">EXISTS</span> <span class="n">Person</span> <span class="p">(</span>
<span class="n">id</span> <span class="nb">int</span><span class="p">,</span>
<span class="n">city_id</span> <span class="nb">int</span><span class="p">,</span>
<span class="n">name</span> <span class="nb">varchar</span><span class="p">,</span>
<span class="n">age</span> <span class="nb">int</span><span class="p">,</span>
<span class="n">company</span> <span class="nb">varchar</span><span class="p">,</span>
<span class="k">PRIMARY</span> <span class="k">KEY</span> <span class="p">(</span><span class="n">id</span><span class="p">,</span> <span class="n">city_id</span><span class="p">)</span>
<span class="p">)</span> <span class="k">WITH</span> <span class="nv">"template=partitioned,backups=1,affinity_key=city_id,CACHE_NAME=Person,KEY_TYPE=PersonKey,VALUE_TYPE=PersonValue"</span><span class="p">;</span></code></pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="use-non-upper-case-columns">Use non-Upper Case Columns</h3>
<div class="paragraph">
<p>Ignite parses all unquoted identifiers, names of a table columns and converts them to uppercase
during the <code>CREATE TABLE</code> command execution which, in turn, makes the command with explicitly defined key
and value types a bit more challenging.</p>
</div>
<div class="paragraph">
<p>There are a few options that might help you to deal with such a case:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Use <a href="/docs/latest/SQL/sql-api">QuerySqlField</a> annotation. This will prevent checking the field non-UpperCase each time because of
an alias for the column is created each time the <code>CREATE TABLE</code> command being executed.</p>
</li>
<li>
<p>Keeping in mind that column names converted each time to the upper case by default, you have to be sure that DDL fields
and cache type fields are always match the letters case.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>In the example below you can see the usage of quotes for the <code>affKey</code> CamelCase field in the <code>CREATE TABLE</code> command with
matching of the same field in the <code>PersonKey</code> cache key type.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sql"><span class="k">CREATE</span> <span class="k">TABLE</span> <span class="n">IF</span> <span class="k">NOT</span> <span class="k">EXISTS</span> <span class="n">Person</span> <span class="p">(</span>
<span class="n">id</span> <span class="nb">INT</span><span class="p">,</span>
<span class="nv">"affKey"</span> <span class="nb">INT</span><span class="p">,</span>
<span class="n">val</span> <span class="nb">VARCHAR</span><span class="p">,</span>
<span class="k">PRIMARY</span> <span class="k">KEY</span> <span class="p">(</span><span class="n">id</span><span class="p">,</span> <span class="nv">"affKey"</span><span class="p">)</span>
<span class="p">)</span> <span class="k">WITH</span> <span class="nv">"template=partitioned,backups=1,affinity_key=affKey,CACHE_NAME=Person,KEY_TYPE=PersonKey,VALUE_TYPE=PersonValue"</span><span class="p">;</span></code></pre>
</div>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="java"><span class="kd">class</span> <span class="nc">PersonKey</span> <span class="o">{</span>
<span class="kd">private</span> <span class="kt">int</span> <span class="n">id</span><span class="o">;</span>
<span class="cm">/*
* This is a camel case field 'affKey' must match the DDL table schema, so you must be sure:
* - Using the quoted "affKey" field name in the DDL table definition;
* - Convert the 'affKey' field to the upper case 'AFFKEY' to match the DDL table definition;
*/</span>
<span class="nd">@AffinityKeyMapped</span>
<span class="kd">private</span> <span class="kt">int</span> <span class="n">affKey</span><span class="o">;</span>
<span class="kd">public</span> <span class="nf">PersonKey</span><span class="o">(</span><span class="kt">int</span> <span class="n">id</span><span class="o">,</span> <span class="kt">int</span> <span class="n">affKey</span><span class="o">)</span> <span class="o">{</span>
<span class="k">this</span><span class="o">.</span><span class="na">id</span> <span class="o">=</span> <span class="n">id</span><span class="o">;</span>
<span class="k">this</span><span class="o">.</span><span class="na">affKey</span> <span class="o">=</span> <span class="n">affKey</span><span class="o">;</span>
<span class="o">}</span>
<span class="o">}</span></code></pre>
</div>
</div>
<div class="paragraph">
<p>Note that some integrations with the Apache Ignite like the <a href="/docs/latest/extensions-and-integrations/spring/spring-data">Spring Data</a>
<code>CrudRepository</code> doesn&#8217;t support the quoted fields to access the data.</p>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="alter-table">ALTER TABLE</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Modify the structure of an existing table.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sql"><span class="k">ALTER</span> <span class="k">TABLE</span> <span class="p">[</span><span class="n">IF</span> <span class="k">EXISTS</span><span class="p">]</span> <span class="n">tableName</span> <span class="p">{</span><span class="n">alter_specification</span><span class="p">}</span>
<span class="n">alter_specification</span><span class="p">:</span>
<span class="k">ADD</span> <span class="p">[</span><span class="k">COLUMN</span><span class="p">]</span> <span class="p">{[</span><span class="n">IF</span> <span class="k">NOT</span> <span class="k">EXISTS</span><span class="p">]</span> <span class="n">tableColumn</span> <span class="o">|</span> <span class="p">(</span><span class="n">tableColumn</span> <span class="p">[,...])}</span>
<span class="o">|</span> <span class="k">DROP</span> <span class="p">[</span><span class="k">COLUMN</span><span class="p">]</span> <span class="p">{[</span><span class="n">IF</span> <span class="k">EXISTS</span><span class="p">]</span> <span class="n">columnName</span> <span class="o">|</span> <span class="p">(</span><span class="n">columnName</span> <span class="p">[,...])}</span>
<span class="o">|</span> <span class="p">{</span><span class="n">LOGGING</span> <span class="o">|</span> <span class="n">NOLOGGING</span><span class="p">}</span>
<span class="n">tableColumn</span> <span class="p">:</span><span class="o">=</span> <span class="n">columnName</span> <span class="n">columnType</span></code></pre>
</div>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<div class="title">Note</div>
</td>
<td class="content">
<h3 id="scope-of-alter-table" class="discrete">Scope of ALTER TABLE</h3>
<div class="paragraph">
<p>Presently, Ignite only supports addition and removal of columns.</p>
</div>
</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>Parameters:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><code>tableName</code> - the name of the table.</p>
</li>
<li>
<p><code>tableColumn</code> - the name and type of the column to be added to the table.</p>
</li>
<li>
<p><code>columnName</code> - the name of the column to be added or removed.</p>
</li>
<li>
<p><code>IF EXISTS</code> - if applied to TABLE, do not throw an error if a table with the specified table name does not exist. If applied to COLUMN, do not throw an error if a column with the specified name does not exist.</p>
</li>
<li>
<p><code>IF NOT EXISTS</code> - do not throw an error if a column with the same name already exists.</p>
</li>
<li>
<p><code>LOGGING</code> - enable <a href="/docs/latest/persistence/native-persistence#write-ahead-log">write-ahead logging</a> for the table. Write-ahead logging in enabled by default. The command is relevant only if Ignite persistence is used.</p>
</li>
<li>
<p><code>NOLOGGING</code> - disable write-ahead logging for the table. The command is relevant only if Ignite persistence is used.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p><code>ALTER TABLE ADD</code> adds a new column or several columns to a previously created table. Once a column is added, it can be accessed using <a href="/docs/latest/sql-reference/dml">DML commands</a> and indexed with the <a href="#create-index">CREATE INDEX</a> statement.</p>
</div>
<div class="paragraph">
<p><code>ALTER TABLE DROP</code> removes an existing column or multiple columns from a table. Once a column is removed, it cannot be accessed within queries. Consider the following notes and limitations:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>The command does not remove actual data from the cluster which means that if the column 'name' is dropped, the value of the 'name' is still stored in the cluster. This limitation is to be addressed in the next releases.</p>
</li>
<li>
<p>If the column was indexed, the index has to be dropped manually using the 'DROP INDEX' command.</p>
</li>
<li>
<p>It is not possible to remove a column that is a primary key or a part of such a key.</p>
</li>
<li>
<p>It is not possible to remove a column if it represents the whole value stored in the cluster. The limitation is relevant for primitive values.
Ignite stores data in the form of key-value pairs and all the new columns will belong to the value. It&#8217;s not possible to change a set of columns of the key (<code>PRIMARY KEY</code>).</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>Both DDL and DML commands targeting the same table are blocked for a short time until <code>ALTER TABLE</code> is in progress.</p>
</div>
<div class="paragraph">
<p>Schema changes applied by this command are persisted on disk if <a href="/docs/latest/persistence/native-persistence">Ignite persistence</a> is enabled. Thus, the changes can survive full cluster restarts.</p>
</div>
<div class="paragraph">
<p>Examples:</p>
</div>
<div class="paragraph">
<p>Add a column to the table:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sql"><span class="k">ALTER</span> <span class="k">TABLE</span> <span class="n">Person</span> <span class="k">ADD</span> <span class="k">COLUMN</span> <span class="n">city</span> <span class="nb">varchar</span><span class="p">;</span></code></pre>
</div>
</div>
<div class="paragraph">
<p>Add a new column to the table only if a column with the same name does not exist:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sql"><span class="k">ALTER</span> <span class="k">TABLE</span> <span class="n">City</span> <span class="k">ADD</span> <span class="k">COLUMN</span> <span class="n">IF</span> <span class="k">NOT</span> <span class="k">EXISTS</span> <span class="n">population</span> <span class="nb">int</span><span class="p">;</span></code></pre>
</div>
</div>
<div class="paragraph">
<p>Add a column​ only if the table exists:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sql"><span class="k">ALTER</span> <span class="k">TABLE</span> <span class="n">IF</span> <span class="k">EXISTS</span> <span class="n">Missing</span> <span class="k">ADD</span> <span class="n">number</span> <span class="n">long</span><span class="p">;</span></code></pre>
</div>
</div>
<div class="paragraph">
<p>Add several columns to the table at once:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sql"><span class="k">ALTER</span> <span class="k">TABLE</span> <span class="n">Region</span> <span class="k">ADD</span> <span class="k">COLUMN</span> <span class="p">(</span><span class="n">code</span> <span class="nb">varchar</span><span class="p">,</span> <span class="n">gdp</span> <span class="nb">double</span><span class="p">);</span></code></pre>
</div>
</div>
<div class="paragraph">
<p>Drop a column from the table:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sql"><span class="k">ALTER</span> <span class="k">TABLE</span> <span class="n">Person</span> <span class="k">DROP</span> <span class="k">COLUMN</span> <span class="n">city</span><span class="p">;</span></code></pre>
</div>
</div>
<div class="paragraph">
<p>Drop a column from the table only if a column with the same name does exist:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sql"><span class="k">ALTER</span> <span class="k">TABLE</span> <span class="n">Person</span> <span class="k">DROP</span> <span class="k">COLUMN</span> <span class="n">IF</span> <span class="k">EXISTS</span> <span class="n">population</span><span class="p">;</span></code></pre>
</div>
</div>
<div class="paragraph">
<p>Drop a column only if the table exists:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sql"><span class="k">ALTER</span> <span class="k">TABLE</span> <span class="n">IF</span> <span class="k">EXISTS</span> <span class="n">Person</span> <span class="k">DROP</span> <span class="k">COLUMN</span> <span class="n">number</span><span class="p">;</span></code></pre>
</div>
</div>
<div class="paragraph">
<p>Drop several columns from the table at once:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sql"><span class="k">ALTER</span> <span class="k">TABLE</span> <span class="n">Person</span> <span class="k">DROP</span> <span class="k">COLUMN</span> <span class="p">(</span><span class="n">code</span><span class="p">,</span> <span class="n">gdp</span><span class="p">);</span></code></pre>
</div>
</div>
<div class="paragraph">
<p>Disable write-ahead logging:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sql"><span class="k">ALTER</span> <span class="k">TABLE</span> <span class="n">Person</span> <span class="n">NOLOGGING</span></code></pre>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="drop-table">DROP TABLE</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The <code>DROP TABLE</code> command drops an existing table.
The underlying cache with all the data in it is destroyed, too.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sql"><span class="k">DROP</span> <span class="k">TABLE</span> <span class="p">[</span><span class="n">IF</span> <span class="k">EXISTS</span><span class="p">]</span> <span class="n">tableName</span></code></pre>
</div>
</div>
<div class="paragraph">
<p>Parameters:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><code>tableName</code> - the name of the table.</p>
</li>
<li>
<p><code>IF NOT EXISTS</code> - do not throw an error if a table with the same name does not exist.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>Both DDL and DML commands targeting the same table are blocked while the <code>DROP TABLE</code> is in progress.
Once the table is dropped, all pending commands will fail with appropriate errors.</p>
</div>
<div class="paragraph">
<p>Schema changes applied by this command are persisted on disk if <a href="/docs/latest/persistence/native-persistence">Ignite persistence</a> is enabled. Thus, the changes can survive full cluster restarts.</p>
</div>
<div class="paragraph">
<p>Examples:</p>
</div>
<div class="paragraph">
<p>Drop Person table if the one exists:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sql"><span class="k">DROP</span> <span class="k">TABLE</span> <span class="n">IF</span> <span class="k">EXISTS</span> <span class="nv">"Person"</span><span class="p">;</span></code></pre>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="create-index">CREATE INDEX</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Create an index on the specified table.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sql"><span class="k">CREATE</span> <span class="p">[</span><span class="n">SPATIAL</span><span class="p">]</span> <span class="k">INDEX</span> <span class="p">[[</span><span class="n">IF</span> <span class="k">NOT</span> <span class="k">EXISTS</span><span class="p">]</span> <span class="n">indexName</span><span class="p">]</span> <span class="k">ON</span> <span class="n">tableName</span>
<span class="p">(</span><span class="n">columnName</span> <span class="p">[</span><span class="k">ASC</span><span class="o">|</span><span class="k">DESC</span><span class="p">]</span> <span class="p">[,...])</span> <span class="p">[(</span><span class="n">index_option</span> <span class="p">[...])]</span>
<span class="n">index_option</span> <span class="p">:</span><span class="o">=</span> <span class="p">{</span><span class="n">INLINE_SIZE</span> <span class="k">size</span> <span class="o">|</span> <span class="n">PARALLEL</span> <span class="n">parallelism_level</span><span class="p">}</span></code></pre>
</div>
</div>
<div class="paragraph">
<p>Parameters:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><code>indexName</code> - the name of the index to be created.</p>
</li>
<li>
<p><code>ASC</code> - specifies ascending sort order (default).</p>
</li>
<li>
<p><code>DESC</code> - specifies descending sort order.</p>
</li>
<li>
<p><code>SPATIAL</code> - create the spatial index. Presently, only geometry types are supported.</p>
</li>
<li>
<p><code>IF NOT EXISTS</code> - do not throw an error if an index with the same name already exists. The database checks indexes' names only, and does not consider columns types or count.</p>
</li>
<li>
<p><code>index_option</code> - additional options for index creation:</p>
<div class="ulist">
<ul>
<li>
<p><code>INLINE_SIZE</code> - specifies index inline size in bytes. Depending on the size, Ignite will place the whole indexed value or a part of it directly into index pages, thus omitting extra calls to data pages and increasing queries' performance. Index inlining is enabled by default and the size is pre-calculated automatically based on the table structure. To disable inlining, set the size to 0 (not recommended). Refer to the <a href="/docs/latest/SQL/sql-tuning#increasing-index-inline-size">Increasing Index Inline Size</a> section for more details.</p>
</li>
<li>
<p><code>PARALLEL</code> - specifies the number of threads to be used in parallel for index creation. The greater number is set, the faster the index is created and built. If the value exceeds the number of CPUs, then it will be decreased to the number of cores. If the parameter is not specified, then the number of threads is calculated as 25% of the CPU cores available.</p>
</li>
</ul>
</div>
</li>
</ul>
</div>
<div class="paragraph">
<p><code>CREATE INDEX</code> creates a new index on the specified table. Regular indexes are stored in the internal B+tree data structures. The B+tree gets distributed across the cluster along with the actual data. A cluster node stores a part of the index for the data it owns.</p>
</div>
<div class="paragraph">
<p>If <code>CREATE INDEX</code> is executed in runtime on live data then the database will iterate over the specified columns synchronously indexing them. The rest of the DDL commands targeting the same table are blocked until CREATE INDEX is in progress. DML command execution is not affected and can be performed in parallel.</p>
</div>
<div class="paragraph">
<p>Schema changes applied by this command are persisted on disk if <a href="/docs/latest/persistence/native-persistence">Ignite persistence</a> is enabled. Thus, the changes can survive full cluster restarts.</p>
</div>
<div class="sect2">
<h3 id="indexes-tradeoffs">Indexes Tradeoffs</h3>
<div class="paragraph">
<p>There are multiple things you should consider when choosing indexes for your application.</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Indexes are not free. They consume memory, and each index needs to be updated separately, thus the performance of write operations might drop if too many indexes are created. On top of that, if a lot of indexes are defined, the optimizer might make more mistakes by choosing the wrong index while building the execution plan.</p>
<div class="admonitionblock warning">
<table>
<tr>
<td class="icon">
<div class="title">Warning</div>
</td>
<td class="content">
It is poor strategy to index everything.
</td>
</tr>
</table>
</div>
</li>
<li>
<p>Indexes are just sorted data structures (B+tree). If you define an index for the fields (a,b,c) then the records will be sorted first by a, then by b and only then by c.</p>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<div class="title">Note</div>
</td>
<td class="content">
<h3 id="example-of-sorted-index" class="discrete">Example of Sorted Index</h3>
<table class="tableblock frame-all grid-all stripes-even" style="width: 25%;">
<colgroup>
<col style="width: 33.3333%;">
<col style="width: 33.3333%;">
<col style="width: 33.3334%;">
</colgroup>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><div class="literal"><pre> A</pre></div></td>
<td class="tableblock halign-left valign-top"><div class="literal"><pre> B</pre></div></td>
<td class="tableblock halign-left valign-top"><div class="literal"><pre> C</pre></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="literal"><pre> 1</pre></div></td>
<td class="tableblock halign-left valign-top"><div class="literal"><pre> 2</pre></div></td>
<td class="tableblock halign-left valign-top"><div class="literal"><pre> 3</pre></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="literal"><pre> 1</pre></div></td>
<td class="tableblock halign-left valign-top"><div class="literal"><pre> 4</pre></div></td>
<td class="tableblock halign-left valign-top"><div class="literal"><pre> 2</pre></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="literal"><pre> 1</pre></div></td>
<td class="tableblock halign-left valign-top"><div class="literal"><pre> 4</pre></div></td>
<td class="tableblock halign-left valign-top"><div class="literal"><pre> 4</pre></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="literal"><pre> 2</pre></div></td>
<td class="tableblock halign-left valign-top"><div class="literal"><pre> 3</pre></div></td>
<td class="tableblock halign-left valign-top"><div class="literal"><pre> 5</pre></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="literal"><pre> 2</pre></div></td>
<td class="tableblock halign-left valign-top"><div class="literal"><pre> 4</pre></div></td>
<td class="tableblock halign-left valign-top"><div class="literal"><pre> 4</pre></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="literal"><pre> 2</pre></div></td>
<td class="tableblock halign-left valign-top"><div class="literal"><pre> 4</pre></div></td>
<td class="tableblock halign-left valign-top"><div class="literal"><pre> 5</pre></div></td>
</tr>
</tbody>
</table>
<div class="paragraph">
<p>Any condition like <code>a = 1 and b &gt; 3</code> can be viewed as a bounded range, both bounds can be quickly looked up in <strong>log(N)</strong> time, the result will be everything between.</p>
</div>
<div class="paragraph">
<p>The following conditions will be able to use the index:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><code>a = ?</code></p>
</li>
<li>
<p><code>a = ? and b = ?</code></p>
</li>
<li>
<p><code>a = ? and b = ? and c = ?</code></p>
</li>
</ul>
</div>
<div class="paragraph">
<p>Condition <code>a = ? and c = ?</code> is no better than <code>a = ?</code> from the index point of view.
Obviously half-bounded ranges like <code>a &gt; ?</code> can be used as well.</p>
</div>
</td>
</tr>
</table>
</div>
</li>
<li>
<p>Indexes on single fields are no better than group indexes on multiple fields starting with the same field (index on (a) is no better than (a,b,c)). Thus it is preferable to use group indexes.</p>
</li>
<li>
<p>When <code>INLINE_SIZE</code> option is specified, indexes holds a prefix of field data in the B+tree pages. This improves search performance by doing less row data retrievals, however substantially increases size of the tree (with a moderate increase in tree height) and reduces data insertion and removal performance due to excessive page splits and merges. It&#8217;s a good idea to consider page size when choosing inlining size for the tree: each B-tree entry requires <code>16 + inline-size</code> bytes in the page (plus header and extra links for the page).</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>Examples:</p>
</div>
<div class="paragraph">
<p>Create a regular index:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sql"><span class="k">CREATE</span> <span class="k">INDEX</span> <span class="n">title_idx</span> <span class="k">ON</span> <span class="n">books</span> <span class="p">(</span><span class="n">title</span><span class="p">);</span></code></pre>
</div>
</div>
<div class="paragraph">
<p>Create a descending index only if it does not exist:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sql"><span class="k">CREATE</span> <span class="k">INDEX</span> <span class="n">IF</span> <span class="k">NOT</span> <span class="k">EXISTS</span> <span class="n">name_idx</span> <span class="k">ON</span> <span class="n">persons</span> <span class="p">(</span><span class="n">firstName</span> <span class="k">DESC</span><span class="p">);</span></code></pre>
</div>
</div>
<div class="paragraph">
<p>Create a composite index:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sql"><span class="k">CREATE</span> <span class="k">INDEX</span> <span class="n">city_idx</span> <span class="k">ON</span> <span class="n">sales</span> <span class="p">(</span><span class="n">country</span><span class="p">,</span> <span class="n">city</span><span class="p">);</span></code></pre>
</div>
</div>
<div class="paragraph">
<p>Create an index specifying data inline size:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sql"><span class="k">CREATE</span> <span class="k">INDEX</span> <span class="n">fast_city_idx</span> <span class="k">ON</span> <span class="n">sales</span> <span class="p">(</span><span class="n">country</span><span class="p">,</span> <span class="n">city</span><span class="p">)</span> <span class="n">INLINE_SIZE</span> <span class="mi">60</span><span class="p">;</span></code></pre>
</div>
</div>
<div class="paragraph">
<p>Create a geospatial​ index:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sql"><span class="k">CREATE</span> <span class="n">SPATIAL</span> <span class="k">INDEX</span> <span class="n">idx_person_address</span> <span class="k">ON</span> <span class="n">Person</span> <span class="p">(</span><span class="n">address</span><span class="p">);</span></code></pre>
</div>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="drop-index">DROP INDEX</h2>
<div class="sectionbody">
<div class="paragraph">
<p><code>DROP INDEX</code> deletes an existing index.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sql"><span class="k">DROP</span> <span class="k">INDEX</span> <span class="p">[</span><span class="n">IF</span> <span class="k">EXISTS</span><span class="p">]</span> <span class="n">indexName</span></code></pre>
</div>
</div>
<div class="paragraph">
<p>Parameters:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><code>indexName</code> - the name of the index to drop.</p>
</li>
<li>
<p><code>IF EXISTS</code> - do not throw an error if an index with the specified name does not exist. The database checks indexes' names only not considering column types or count.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>DDL commands targeting the same table are blocked until <code>DROP INDEX</code> is in progress. DML command execution is not affected and can be performed in parallel.</p>
</div>
<div class="paragraph">
<p>Schema changes applied by this command are persisted on disk if <a href="/docs/latest/persistence/native-persistence">Ignite persistence</a> is enabled. Thus, the changes can survive full cluster restarts.</p>
</div>
<h3 id="examples" class="discrete">Examples</h3>
<div class="paragraph">
<p>Drop an index:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sql"><span class="k">DROP</span> <span class="k">INDEX</span> <span class="n">idx_person_name</span><span class="p">;</span></code></pre>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="create-user">CREATE USER</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The command creates a user with a given name and password.</p>
</div>
<div class="paragraph">
<p>A new user can only be created using a superuser account when authentication for thin clients is enabled. Ignite creates the superuser account under the name <code>ignite</code> and password <code>ignite</code> on the first cluster start-up. Presently, you can&#8217;t rename the superuser account nor grant its privileges to any other account.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sql"><span class="k">CREATE</span> <span class="k">USER</span> <span class="n">userName</span> <span class="k">WITH</span> <span class="n">PASSWORD</span> <span class="s1">'password'</span><span class="p">;</span></code></pre>
</div>
</div>
<div class="paragraph">
<p>Parameters:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><code>userName</code> - new user&#8217;s name. The name cannot be longer than 60 bytes in UTF8 encoding.</p>
</li>
<li>
<p><code>password</code> - new user&#8217;s password. An empty password is not allowed.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>To create a <em>case-sensitive</em> username, use the quotation (") SQL identifier.</p>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<div class="title">Note</div>
</td>
<td class="content">
<h3 id="when-are-case-sensitive-names-preferred" class="discrete">When Are Case-Sensitive Names Preferred?</h3>
<div class="paragraph">
<p>The case-insensitivity property of the usernames is supported for JDBC and ODBC interfaces only. If it&#8217;s planned to access Ignite from Java, .NET, or other programming language APIs then the username has to be passed either in all upper-case letters or enclosed in double quotes (") from those interfaces.</p>
</div>
<div class="paragraph">
<p>For instance, if <code>Test</code> was set as a username then:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>You can use <code>Test</code>, <code>TEst</code>, <code>TEST</code> and other combinations from JDBC and ODBC.</p>
</li>
<li>
<p>You can use either <code>TEST</code> or <code>"Test"</code> as the username from Ignite&#8217;s native SQL APIs designed for Java, .NET and other programming languages.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>Alternatively, use the case-sensitive username at all times to ensure name consistency across all the SQL interfaces.</p>
</div>
</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>Examples:</p>
</div>
<div class="paragraph">
<p>Create a new user using test as a name and password:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sql"><span class="k">CREATE</span> <span class="k">USER</span> <span class="n">test</span> <span class="k">WITH</span> <span class="n">PASSWORD</span> <span class="s1">'test'</span><span class="p">;</span></code></pre>
</div>
</div>
<div class="paragraph">
<p>Create a case-sensitive username:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sql"><span class="k">CREATE</span> <span class="k">USER</span> <span class="nv">"TeSt"</span> <span class="k">WITH</span> <span class="n">PASSWORD</span> <span class="s1">'test'</span></code></pre>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="alter-user">ALTER USER</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The command changes an existing user&#8217;s password.
The password can be updated by the superuser (<code>ignite</code>, see <a href="#create-user">CREATE USER</a> for more details) or by the user themselves.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sql"><span class="k">ALTER</span> <span class="k">USER</span> <span class="n">userName</span> <span class="k">WITH</span> <span class="n">PASSWORD</span> <span class="s1">'newPassword'</span><span class="p">;</span></code></pre>
</div>
</div>
<div class="paragraph">
<p>Parameters:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><code>userName</code> - existing user&#8217;s name.</p>
</li>
<li>
<p><code>newPassword</code> - the new password to set for the user&#8217;s account.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>Examples:</p>
</div>
<div class="paragraph">
<p>Updating user&#8217;s password:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sql"><span class="k">ALTER</span> <span class="k">USER</span> <span class="n">test</span> <span class="k">WITH</span> <span class="n">PASSWORD</span> <span class="s1">'test123'</span><span class="p">;</span></code></pre>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="drop-user">DROP USER</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The command removes an existing user.</p>
</div>
<div class="paragraph">
<p>The user can be removed only by the superuser (<code>ignite</code>, see <a href="#create-user">CREATE USER</a> for more details).</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sql"><span class="k">DROP</span> <span class="k">USER</span> <span class="n">userName</span><span class="p">;</span></code></pre>
</div>
</div>
<div class="paragraph">
<p>Parameters:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><code>userName</code> - a name of the user to remove.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>Examples:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sql"><span class="k">DROP</span> <span class="k">USER</span> <span class="n">test</span><span class="p">;</span></code></pre>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="analyze">ANALYZE</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The ANALYZE command collects <a href="/docs/latest/SQL/sql-statistics" target="_blank" rel="noopener">statistics</a>.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sql"><span class="k">ANALYZE</span> <span class="s1">'schemaName'</span><span class="p">.</span><span class="s1">'tableName'</span><span class="p">(</span><span class="n">column1</span><span class="p">,</span> <span class="n">column2</span><span class="p">);</span></code></pre>
</div>
</div>
<div class="paragraph">
<p>Parameters:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><code>schemaName</code> - a name of the schema to collect statistics for.</p>
</li>
<li>
<p><code>tableName</code> - a name of the table to collect statistics for.</p>
</li>
<li>
<p><code>(column1, column2)</code> - names of the columns to collect statistics for.</p>
</li>
</ul>
</div>
<div class="imageblock">
<div class="content">
<svg class="railroad-diagram" width="689.5" height="131" viewBox="0 0 689.5 131" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g transform="translate(.5 .5)">
<g>
<path d="M20 30v20m10 -20v20m-10 -10h20"></path>
</g>
<path d="M40 40h10"></path>
<g class="terminal ">
<path d="M50 40h0"></path>
<path d="M129.5 40h0"></path>
<rect x="50" y="29" width="79.5" height="22" rx="10" ry="10"></rect>
<text x="89.75" y="44">ANALYZE</text>
</g>
<path d="M129.5 40h10"></path>
<path d="M139.5 40h10"></path>
<g>
<path d="M149.5 40h0"></path>
<path d="M639.5 40h0"></path>
<path d="M149.5 40h10"></path>
<g>
<path d="M159.5 40h0"></path>
<path d="M629.5 40h0"></path>
<g>
<path d="M159.5 40h0"></path>
<path d="M319 40h0"></path>
<path d="M159.5 40a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path>
<g>
<path d="M179.5 20h119.5"></path>
</g>
<path d="M299 20a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path>
<path d="M159.5 40h20"></path>
<g>
<path d="M179.5 40h0"></path>
<path d="M299 40h0"></path>
<g class="terminal ">
<path d="M179.5 40h0"></path>
<path d="M250.5 40h0"></path>
<rect x="179.5" y="29" width="71" height="22" rx="10" ry="10"></rect>
<text x="215" y="44">SCHEMA</text>
</g>
<path d="M250.5 40h10"></path>
<path d="M260.5 40h10"></path>
<g class="terminal ">
<path d="M270.5 40h0"></path>
<path d="M299 40h0"></path>
<rect x="270.5" y="29" width="28.5" height="22" rx="10" ry="10"></rect>
<text x="284.75" y="44">.</text>
</g>
</g>
<path d="M299 40h20"></path>
</g>
<path d="M319 40h10"></path>
<g class="terminal ">
<path d="M329 40h0"></path>
<path d="M391.5 40h0"></path>
<rect x="329" y="29" width="62.5" height="22" rx="10" ry="10"></rect>
<text x="360.25" y="44">TABLE</text>
</g>
<path d="M391.5 40h10"></path>
<g>
<path d="M401.5 40h0"></path>
<path d="M629.5 40h0"></path>
<path d="M401.5 40a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path>
<g>
<path d="M421.5 20h188"></path>
</g>
<path d="M609.5 20a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path>
<path d="M401.5 40h20"></path>
<g>
<path d="M421.5 40h0"></path>
<path d="M609.5 40h0"></path>
<g class="terminal ">
<path d="M421.5 40h0"></path>
<path d="M450 40h0"></path>
<rect x="421.5" y="29" width="28.5" height="22" rx="10" ry="10"></rect>
<text x="435.75" y="44">(</text>
</g>
<path d="M450 40h10"></path>
<path d="M460 40h10"></path>
<g>
<path d="M470 40h0"></path>
<path d="M561 40h0"></path>
<path d="M470 40h10"></path>
<g class="terminal ">
<path d="M480 40h0"></path>
<path d="M551 40h0"></path>
<rect x="480" y="29" width="71" height="22" rx="10" ry="10"></rect>
<text x="515.5" y="44">COLUMN</text>
</g>
<path d="M551 40h10"></path>
<path d="M480 40a10 10 0 0 0 -10 10v10a10 10 0 0 0 10 10"></path>
<g class="terminal ">
<path d="M480 70h21.25"></path>
<path d="M529.75 70h21.25"></path>
<rect x="501.25" y="59" width="28.5" height="22" rx="10" ry="10"></rect>
<text x="515.5" y="74">,</text>
</g>
<path d="M551 70a10 10 0 0 0 10 -10v-10a10 10 0 0 0 -10 -10"></path>
</g>
<path d="M561 40h10"></path>
<path d="M571 40h10"></path>
<g class="terminal ">
<path d="M581 40h0"></path>
<path d="M609.5 40h0"></path>
<rect x="581" y="29" width="28.5" height="22" rx="10" ry="10"></rect>
<text x="595.25" y="44">)</text>
</g>
</g>
<path d="M609.5 40h20"></path>
</g>
</g>
<path d="M629.5 40h10"></path>
<path d="M159.5 40a10 10 0 0 0 -10 10v40a10 10 0 0 0 10 10"></path>
<g class="terminal ">
<path d="M159.5 100h220.75"></path>
<path d="M408.75 100h220.75"></path>
<rect x="380.25" y="89" width="28.5" height="22" rx="10" ry="10"></rect>
<text x="394.5" y="104">,</text>
</g>
<path d="M629.5 100a10 10 0 0 0 10 -10v-40a10 10 0 0 0 -10 -10"></path>
</g>
<path d="M639.5 40h10"></path>
<path stroke-dasharray="5,5" d="M655 40 l30 0" />
</g>
<style>
svg {
background-color: hsl(0,0%,100%);
}
path {
stroke-width: 2;
stroke: black;
fill: rgba(0,0,0,0);
}
text {
font: bold 14px monospace;
text-anchor: middle;
white-space: pre;
}
text.diagram-text {
font-size: 12px;
}
text.diagram-arrow {
font-size: 16px;
}
text.label {
text-anchor: start;
}
text.comment {
font: italic 12px monospace;
}
g.non-terminal text {
/&#42;font-style: italic;&#42;/
}
rect {
stroke-width: 2;
stroke: black;
fill: hsl(0,0%,100%);
}
rect.group-box {
stroke: gray;
stroke-dasharray: 10 5;
fill: none;
}
path.diagram-text {
stroke-width: 2;
stroke: black;
fill: white;
cursor: help;
}
g.diagram-text:hover path.diagram-text {
fill: #eee;
}</style>
</svg>
</div>
</div>
<div class="imageblock">
<div class="content">
<svg class="railroad-diagram" width="573" height="101" viewBox="0 0 573 101" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g transform="translate(.5 .5)">
<g fill="none" stroke="black" stroke-width="2">
<path stroke-dasharray="5,5" d="M10 40 l30 0" />
</g>
<g>
<path d="M40 40h0"></path>
<path d="M464.5 40h0"></path>
<path d="M40 40a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path>
<g>
<path d="M60 20h384.5"></path>
</g>
<path d="M444.5 20a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path>
<path d="M40 40h20"></path>
<g>
<path d="M60 40h0"></path>
<path d="M444.5 40h0"></path>
<g class="terminal ">
<path d="M60 40h0"></path>
<path d="M114 40h0"></path>
<rect x="60" y="29" width="54" height="22" rx="10" ry="10"></rect>
<text x="87" y="44">WITH</text>
</g>
<path d="M114 40h10"></path>
<path d="M124 40h10"></path>
<g class="terminal ">
<path d="M134 40h0"></path>
<path d="M162.5 40h0"></path>
<rect x="134" y="29" width="28.5" height="22" rx="10" ry="10"></rect>
<text x="148.25" y="44">'</text>
</g>
<path d="M162.5 40h10"></path>
<path d="M172.5 40h10"></path>
<g>
<path d="M182.5 40h0"></path>
<path d="M396 40h0"></path>
<path d="M182.5 40h10"></path>
<g>
<path d="M192.5 40h0"></path>
<path d="M386 40h0"></path>
<g class="terminal ">
<path d="M192.5 40h0"></path>
<path d="M255 40h0"></path>
<rect x="192.5" y="29" width="62.5" height="22" rx="10" ry="10"></rect>
<text x="223.75" y="44">PARAM</text>
</g>
<path d="M255 40h10"></path>
<path d="M265 40h10"></path>
<g class="terminal ">
<path d="M275 40h0"></path>
<path d="M303.5 40h0"></path>
<rect x="275" y="29" width="28.5" height="22" rx="10" ry="10"></rect>
<text x="289.25" y="44">=</text>
</g>
<path d="M303.5 40h10"></path>
<path d="M313.5 40h10"></path>
<g class="terminal ">
<path d="M323.5 40h0"></path>
<path d="M386 40h0"></path>
<rect x="323.5" y="29" width="62.5" height="22" rx="10" ry="10"></rect>
<text x="354.75" y="44">VALUE</text>
</g>
</g>
<path d="M386 40h10"></path>
<path d="M192.5 40a10 10 0 0 0 -10 10v10a10 10 0 0 0 10 10"></path>
<g class="terminal ">
<path d="M192.5 70h82.5"></path>
<path d="M303.5 70h82.5"></path>
<rect x="275" y="59" width="28.5" height="22" rx="10" ry="10"></rect>
<text x="289.25" y="74">,</text>
</g>
<path d="M386 70a10 10 0 0 0 10 -10v-10a10 10 0 0 0 -10 -10"></path>
</g>
<path d="M396 40h10"></path>
<path d="M406 40h10"></path>
<g class="terminal ">
<path d="M416 40h0"></path>
<path d="M444.5 40h0"></path>
<rect x="416" y="29" width="28.5" height="22" rx="10" ry="10"></rect>
<text x="430.25" y="44">'</text>
</g>
</g>
<path d="M444.5 40h20"></path>
</g>
<g>
<path d="M464.5 40h0"></path>
<path d="M533 40h0"></path>
<path d="M464.5 40a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path>
<g>
<path d="M484.5 20h28.5"></path>
</g>
<path d="M513 20a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path>
<path d="M464.5 40h20"></path>
<g class="terminal ">
<path d="M484.5 40h0"></path>
<path d="M513 40h0"></path>
<rect x="484.5" y="29" width="28.5" height="22" rx="10" ry="10"></rect>
<text x="498.75" y="44">;</text>
</g>
<path d="M513 40h20"></path>
</g>
<path d="M 533 40 h 20 m -10 -10 v 20 m 10 -20 v 20"></path>
</g>
<style>
svg {
background-color: hsl(0,0%,100%);
}
path {
stroke-width: 2;
stroke: black;
fill: rgba(0,0,0,0);
}
text {
font: bold 14px monospace;
text-anchor: middle;
white-space: pre;
}
text.diagram-text {
font-size: 12px;
}
text.diagram-arrow {
font-size: 16px;
}
text.label {
text-anchor: start;
}
text.comment {
font: italic 12px monospace;
}
g.non-terminal text {
/&#42;font-style: italic;&#42;/
}
rect {
stroke-width: 2;
stroke: black;
fill: hsl(0,0%,100%);
}
rect.group-box {
stroke: gray;
stroke-dasharray: 10 5;
fill: none;
}
path.diagram-text {
stroke-width: 2;
stroke: black;
fill: white;
cursor: help;
}
g.diagram-text:hover path.diagram-text {
fill: #eee;
}</style>
</svg>
</div>
</div>
<div class="paragraph">
<p>When the ANALYZE command is used with <code>with</code> parameters statement, specified parameters are applied for every target. For example:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sql"><span class="k">ANALYZE</span> <span class="k">public</span><span class="p">.</span><span class="n">statistics_test</span><span class="p">,</span> <span class="n">statistics_test2</span><span class="p">,</span> <span class="n">statistics_test3</span><span class="p">(</span><span class="n">col3</span><span class="p">)</span> <span class="k">WITH</span> <span class="s1">'MAX_CHANGED_PARTITION_ROWS_PERCENT=15,NULLS=0'</span></code></pre>
</div>
</div>
<div class="paragraph">
<p>Possible parameters:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>MAX_CHANGED_PARTITION_ROWS_PERCENT - Maximum percentage of outdated rows in the table (the default value is 15%). See the <a href="/docs/latest/SQL/sql-statistics#statistics-obsolescence" target="_blank" rel="noopener">SQL Statistics</a> page for more details.</p>
</li>
<li>
<p>NULLS - Number of null values in column.</p>
</li>
<li>
<p>TOTAL - Total number of column values.</p>
</li>
<li>
<p>SIZE - Average size of column values (in bytes).</p>
</li>
<li>
<p>DISTINCT - Number of distinct non-null values in column.</p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="refresh">REFRESH</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The command refreshes <a href="/docs/latest/SQL/sql-statistics" target="_blank" rel="noopener">statistics</a>.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sql"><span class="n">REFRESH</span> <span class="s1">'schemaName'</span><span class="p">.</span><span class="s1">'tableName'</span><span class="p">(</span><span class="n">column1</span><span class="p">,</span> <span class="n">column2</span><span class="p">);</span></code></pre>
</div>
</div>
<div class="paragraph">
<p>Parameters:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><code>schemaName</code> - a name of the schema to refresh statistics for.</p>
</li>
<li>
<p><code>tableName</code> - a name of the table to refresh statistics for.</p>
</li>
<li>
<p><code>(column1, column2)</code> - names of the columns to refresh statistics for.</p>
</li>
</ul>
</div>
<div class="imageblock">
<div class="content">
<svg class="railroad-diagram" width="689.5" height="131" viewBox="0 0 689.5 131" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g transform="translate(.5 .5)">
<g>
<path d="M20 30v20m10 -20v20m-10 -10h20"></path>
</g>
<path d="M40 40h10"></path>
<g class="terminal ">
<path d="M50 40h0"></path>
<path d="M129.5 40h0"></path>
<rect x="50" y="29" width="79.5" height="22" rx="10" ry="10"></rect>
<text x="89.75" y="44">REFRESH</text>
</g>
<path d="M129.5 40h10"></path>
<path d="M139.5 40h10"></path>
<g>
<path d="M149.5 40h0"></path>
<path d="M639.5 40h0"></path>
<path d="M149.5 40h10"></path>
<g>
<path d="M159.5 40h0"></path>
<path d="M629.5 40h0"></path>
<g>
<path d="M159.5 40h0"></path>
<path d="M319 40h0"></path>
<path d="M159.5 40a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path>
<g>
<path d="M179.5 20h119.5"></path>
</g>
<path d="M299 20a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path>
<path d="M159.5 40h20"></path>
<g>
<path d="M179.5 40h0"></path>
<path d="M299 40h0"></path>
<g class="terminal ">
<path d="M179.5 40h0"></path>
<path d="M250.5 40h0"></path>
<rect x="179.5" y="29" width="71" height="22" rx="10" ry="10"></rect>
<text x="215" y="44">SCHEMA</text>
</g>
<path d="M250.5 40h10"></path>
<path d="M260.5 40h10"></path>
<g class="terminal ">
<path d="M270.5 40h0"></path>
<path d="M299 40h0"></path>
<rect x="270.5" y="29" width="28.5" height="22" rx="10" ry="10"></rect>
<text x="284.75" y="44">.</text>
</g>
</g>
<path d="M299 40h20"></path>
</g>
<path d="M319 40h10"></path>
<g class="terminal ">
<path d="M329 40h0"></path>
<path d="M391.5 40h0"></path>
<rect x="329" y="29" width="62.5" height="22" rx="10" ry="10"></rect>
<text x="360.25" y="44">TABLE</text>
</g>
<path d="M391.5 40h10"></path>
<g>
<path d="M401.5 40h0"></path>
<path d="M629.5 40h0"></path>
<path d="M401.5 40a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path>
<g>
<path d="M421.5 20h188"></path>
</g>
<path d="M609.5 20a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path>
<path d="M401.5 40h20"></path>
<g>
<path d="M421.5 40h0"></path>
<path d="M609.5 40h0"></path>
<g class="terminal ">
<path d="M421.5 40h0"></path>
<path d="M450 40h0"></path>
<rect x="421.5" y="29" width="28.5" height="22" rx="10" ry="10"></rect>
<text x="435.75" y="44">(</text>
</g>
<path d="M450 40h10"></path>
<path d="M460 40h10"></path>
<g>
<path d="M470 40h0"></path>
<path d="M561 40h0"></path>
<path d="M470 40h10"></path>
<g class="terminal ">
<path d="M480 40h0"></path>
<path d="M551 40h0"></path>
<rect x="480" y="29" width="71" height="22" rx="10" ry="10"></rect>
<text x="515.5" y="44">COLUMN</text>
</g>
<path d="M551 40h10"></path>
<path d="M480 40a10 10 0 0 0 -10 10v10a10 10 0 0 0 10 10"></path>
<g class="terminal ">
<path d="M480 70h21.25"></path>
<path d="M529.75 70h21.25"></path>
<rect x="501.25" y="59" width="28.5" height="22" rx="10" ry="10"></rect>
<text x="515.5" y="74">,</text>
</g>
<path d="M551 70a10 10 0 0 0 10 -10v-10a10 10 0 0 0 -10 -10"></path>
</g>
<path d="M561 40h10"></path>
<path d="M571 40h10"></path>
<g class="terminal ">
<path d="M581 40h0"></path>
<path d="M609.5 40h0"></path>
<rect x="581" y="29" width="28.5" height="22" rx="10" ry="10"></rect>
<text x="595.25" y="44">)</text>
</g>
</g>
<path d="M609.5 40h20"></path>
</g>
</g>
<path d="M629.5 40h10"></path>
<path d="M159.5 40a10 10 0 0 0 -10 10v40a10 10 0 0 0 10 10"></path>
<g class="terminal ">
<path d="M159.5 100h220.75"></path>
<path d="M408.75 100h220.75"></path>
<rect x="380.25" y="89" width="28.5" height="22" rx="10" ry="10"></rect>
<text x="394.5" y="104">,</text>
</g>
<path d="M629.5 100a10 10 0 0 0 10 -10v-40a10 10 0 0 0 -10 -10"></path>
</g>
<path d="M639.5 40h10"></path>
<path d="M 649.5 40 h 20 m -10 -10 v 20 m 10 -20 v 20"></path>
</g>
<style>
svg {
background-color: hsl(0,0%,100%);
}
path {
stroke-width: 2;
stroke: black;
fill: rgba(0,0,0,0);
}
text {
font: bold 14px monospace;
text-anchor: middle;
white-space: pre;
}
text.diagram-text {
font-size: 12px;
}
text.diagram-arrow {
font-size: 16px;
}
text.label {
text-anchor: start;
}
text.comment {
font: italic 12px monospace;
}
g.non-terminal text {
/&#42;font-style: italic;&#42;/
}
rect {
stroke-width: 2;
stroke: black;
fill: hsl(0,0%,100%);
}
rect.group-box {
stroke: gray;
stroke-dasharray: 10 5;
fill: none;
}
path.diagram-text {
stroke-width: 2;
stroke: black;
fill: white;
cursor: help;
}
g.diagram-text:hover path.diagram-text {
fill: #eee;
}</style>
</svg>
</div>
</div>
<div class="paragraph">
<p>Example:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sql"><span class="n">REFRESH</span> <span class="n">PRODUCTS</span><span class="p">,</span> <span class="n">SALE</span><span class="p">(</span><span class="n">productId</span><span class="p">,</span> <span class="n">discount</span><span class="p">)</span></code></pre>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="drop-statistics">DROP STATISTICS</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The command drops <a href="/docs/latest/SQL/sql-statistics" target="_blank" rel="noopener">statistics</a>.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sql"><span class="k">DROP</span> <span class="k">STATISTICS</span> <span class="s1">'schemaName'</span><span class="p">.</span><span class="s1">'tableName'</span><span class="p">(</span><span class="n">column1</span><span class="p">,</span> <span class="n">column2</span><span class="p">);</span></code></pre>
</div>
</div>
<div class="paragraph">
<p>Parameters:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><code>schemaName</code> - a name of the schema to drop statistics for.</p>
</li>
<li>
<p><code>tableName</code> - a name of the table to drop statistics for.</p>
</li>
<li>
<p><code>(column1, column2)</code> - names of the columns to drop statistics for.</p>
</li>
</ul>
</div>
<div class="imageblock">
<div class="content">
<svg class="railroad-diagram" width="757.5" height="131" viewBox="0 0 757.5 131" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g transform="translate(.5 .5)">
<g>
<path d="M20 30v20m10 -20v20m-10 -10h20"></path>
</g>
<path d="M40 40h10"></path>
<g class="terminal ">
<path d="M50 40h0"></path>
<path d="M197.5 40h0"></path>
<rect x="50" y="29" width="147.5" height="22" rx="10" ry="10"></rect>
<text x="123.75" y="44">DROP STATISTICS</text>
</g>
<path d="M197.5 40h10"></path>
<path d="M207.5 40h10"></path>
<g>
<path d="M217.5 40h0"></path>
<path d="M707.5 40h0"></path>
<path d="M217.5 40h10"></path>
<g>
<path d="M227.5 40h0"></path>
<path d="M697.5 40h0"></path>
<g>
<path d="M227.5 40h0"></path>
<path d="M387 40h0"></path>
<path d="M227.5 40a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path>
<g>
<path d="M247.5 20h119.5"></path>
</g>
<path d="M367 20a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path>
<path d="M227.5 40h20"></path>
<g>
<path d="M247.5 40h0"></path>
<path d="M367 40h0"></path>
<g class="terminal ">
<path d="M247.5 40h0"></path>
<path d="M318.5 40h0"></path>
<rect x="247.5" y="29" width="71" height="22" rx="10" ry="10"></rect>
<text x="283" y="44">SCHEMA</text>
</g>
<path d="M318.5 40h10"></path>
<path d="M328.5 40h10"></path>
<g class="terminal ">
<path d="M338.5 40h0"></path>
<path d="M367 40h0"></path>
<rect x="338.5" y="29" width="28.5" height="22" rx="10" ry="10"></rect>
<text x="352.75" y="44">.</text>
</g>
</g>
<path d="M367 40h20"></path>
</g>
<path d="M387 40h10"></path>
<g class="terminal ">
<path d="M397 40h0"></path>
<path d="M459.5 40h0"></path>
<rect x="397" y="29" width="62.5" height="22" rx="10" ry="10"></rect>
<text x="428.25" y="44">TABLE</text>
</g>
<path d="M459.5 40h10"></path>
<g>
<path d="M469.5 40h0"></path>
<path d="M697.5 40h0"></path>
<path d="M469.5 40a10 10 0 0 0 10 -10v0a10 10 0 0 1 10 -10"></path>
<g>
<path d="M489.5 20h188"></path>
</g>
<path d="M677.5 20a10 10 0 0 1 10 10v0a10 10 0 0 0 10 10"></path>
<path d="M469.5 40h20"></path>
<g>
<path d="M489.5 40h0"></path>
<path d="M677.5 40h0"></path>
<g class="terminal ">
<path d="M489.5 40h0"></path>
<path d="M518 40h0"></path>
<rect x="489.5" y="29" width="28.5" height="22" rx="10" ry="10"></rect>
<text x="503.75" y="44">(</text>
</g>
<path d="M518 40h10"></path>
<path d="M528 40h10"></path>
<g>
<path d="M538 40h0"></path>
<path d="M629 40h0"></path>
<path d="M538 40h10"></path>
<g class="terminal ">
<path d="M548 40h0"></path>
<path d="M619 40h0"></path>
<rect x="548" y="29" width="71" height="22" rx="10" ry="10"></rect>
<text x="583.5" y="44">COLUMN</text>
</g>
<path d="M619 40h10"></path>
<path d="M548 40a10 10 0 0 0 -10 10v10a10 10 0 0 0 10 10"></path>
<g class="terminal ">
<path d="M548 70h21.25"></path>
<path d="M597.75 70h21.25"></path>
<rect x="569.25" y="59" width="28.5" height="22" rx="10" ry="10"></rect>
<text x="583.5" y="74">,</text>
</g>
<path d="M619 70a10 10 0 0 0 10 -10v-10a10 10 0 0 0 -10 -10"></path>
</g>
<path d="M629 40h10"></path>
<path d="M639 40h10"></path>
<g class="terminal ">
<path d="M649 40h0"></path>
<path d="M677.5 40h0"></path>
<rect x="649" y="29" width="28.5" height="22" rx="10" ry="10"></rect>
<text x="663.25" y="44">)</text>
</g>
</g>
<path d="M677.5 40h20"></path>
</g>
</g>
<path d="M697.5 40h10"></path>
<path d="M227.5 40a10 10 0 0 0 -10 10v40a10 10 0 0 0 10 10"></path>
<g class="terminal ">
<path d="M227.5 100h220.75"></path>
<path d="M476.75 100h220.75"></path>
<rect x="448.25" y="89" width="28.5" height="22" rx="10" ry="10"></rect>
<text x="462.5" y="104">,</text>
</g>
<path d="M697.5 100a10 10 0 0 0 10 -10v-40a10 10 0 0 0 -10 -10"></path>
</g>
<path d="M707.5 40h10"></path>
<path d="M 717.5 40 h 20 m -10 -10 v 20 m 10 -20 v 20"></path>
</g>
<style>
svg {
background-color: hsl(0,0%,100%);
}
path {
stroke-width: 2;
stroke: black;
fill: rgba(0,0,0,0);
}
text {
font: bold 14px monospace;
text-anchor: middle;
white-space: pre;
}
text.diagram-text {
font-size: 12px;
}
text.diagram-arrow {
font-size: 16px;
}
text.label {
text-anchor: start;
}
text.comment {
font: italic 12px monospace;
}
g.non-terminal text {
/&#42;font-style: italic;&#42;/
}
rect {
stroke-width: 2;
stroke: black;
fill: hsl(0,0%,100%);
}
rect.group-box {
stroke: gray;
stroke-dasharray: 10 5;
fill: none;
}
path.diagram-text {
stroke-width: 2;
stroke: black;
fill: white;
cursor: help;
}
g.diagram-text:hover path.diagram-text {
fill: #eee;
}</style>
</svg>
</div>
</div>
<div class="paragraph">
<p>Example:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="sql"><span class="k">DROP</span> <span class="k">STATISTICS</span> <span class="n">USERS</span><span class="p">,</span> <span class="n">ORDERS</span><span class="p">(</span><span class="n">customerId</span><span class="p">,</span> <span class="n">productId</span><span class="p">)</span></code></pre>
</div>
</div>
</div>
</div>
<div class="copyright">
© 2022 The Apache Software Foundation.<br/>
Apache, Apache Ignite, the Apache feather and the Apache Ignite logo are either registered trademarks or trademarks of The Apache Software Foundation.
</div>
</article>
<nav class="right-nav" data-swiftype-index='false'>
<div class="toc-wrapper">
<ul class="sectlevel1">
<li><a href="#create-table">CREATE TABLE</a>
<ul class="sectlevel2">
<li><a href="#define-primary-key">Define Primary Key</a></li>
<li><a href="#use-non-sql-api">Use non-SQL API</a></li>
<li><a href="#use-non-upper-case-columns">Use non-Upper Case Columns</a></li>
</ul>
</li>
<li><a href="#alter-table">ALTER TABLE</a></li>
<li><a href="#drop-table">DROP TABLE</a></li>
<li><a href="#create-index">CREATE INDEX</a>
<ul class="sectlevel2">
<li><a href="#indexes-tradeoffs">Indexes Tradeoffs</a></li>
</ul>
</li>
<li><a href="#drop-index">DROP INDEX</a></li>
<li><a href="#create-user">CREATE USER</a></li>
<li><a href="#alter-user">ALTER USER</a></li>
<li><a href="#drop-user">DROP USER</a></li>
<li><a href="#analyze">ANALYZE</a></li>
<li><a href="#refresh">REFRESH</a></li>
<li><a href="#drop-statistics">DROP STATISTICS</a></li>
</ul>
</div>
<nav class="promo-nav">
<!--#include virtual="/includes/docs_rightnav_promotion.html" -->
<a href="#" data-trigger-bugyard-feedback="true" id="doc-feedback-btn">Docs Feedback</a>
</nav>
</nav>
</section>
<script type='module' src='/assets/js/code-copy-to-clipboard.js' async crossorigin></script>
<script>
// inits deep anchors -- needs to be done here because of https://www.bryanbraun.com/anchorjs/#dont-run-it-too-late
anchors.add('.page-docs h1, .page-docs h2, .page-docs h3:not(.discrete), .page-docs h4, .page-docs h5');
anchors.options = {
placement: 'right',
visible: 'always'
};
</script>
<script src="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js"></script>
<script>
docsearch({
// Your apiKey and indexName will be given to you once
// we create your config
apiKey: '3eee686c0ebe39eff3baeb18c56fa5f8',
indexName: 'apache_ignite',
// Replace inputSelector with a CSS selector
// matching your search input
inputSelector: '#search-input',
// algoliaOptions: { 'facetFilters': ["version:$VERSION"] },
// Set debug to true to inspect the dropdown
debug: false,
});
</script>
<script type='module' src='/assets/js/index.js?1654071159' async crossorigin></script>
<script type='module' src='/assets/js/versioning.js?1654071159' async crossorigin></script>
<link rel="stylesheet" href="/assets/css/styles.css?1654071159" media="print" onload="this.media='all'">
<noscript><link media="all" rel="stylesheet" href="/assets/css/styles.css?1654071159"></noscript>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css" media="print" onload="this.media='all'">
<noscript><link media="all" rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css"></noscript>
</body>
</html>