| "use strict";(self.webpackChunk=self.webpackChunk||[]).push([[5597],{3905:(e,t,r)=>{r.d(t,{Zo:()=>m,kt:()=>b});var n=r(67294);function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach((function(t){i(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function u(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var l=n.createContext({}),s=function(e){var t=n.useContext(l),r=t;return e&&(r="function"==typeof e?e(t):a(a({},t),e)),r},m=function(e){var t=s(e.components);return n.createElement(l.Provider,{value:t},e.children)},d="mdxType",p={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},c=n.forwardRef((function(e,t){var r=e.components,i=e.mdxType,o=e.originalType,l=e.parentName,m=u(e,["components","mdxType","originalType","parentName"]),d=s(r),c=i,b=d["".concat(l,".").concat(c)]||d[c]||p[c]||o;return r?n.createElement(b,a(a({ref:t},m),{},{components:r})):n.createElement(b,a({ref:t},m))}));function b(e,t){var r=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var o=r.length,a=new Array(o);a[0]=c;var u={};for(var l in t)hasOwnProperty.call(t,l)&&(u[l]=t[l]);u.originalType=e,u[d]="string"==typeof e?e:i,a[1]=u;for(var s=2;s<o;s++)a[s]=r[s];return n.createElement.apply(null,a)}return n.createElement.apply(null,r)}c.displayName="MDXCreateElement"},117:(e,t,r)=>{r.r(t),r.d(t,{assets:()=>m,contentTitle:()=>l,default:()=>b,frontMatter:()=>u,metadata:()=>s,toc:()=>d});var n=r(87462),i=r(63366),o=(r(67294),r(3905)),a=["components"],u={id:"migr-subquery-limit",title:"Migration guide: Subquery limit",sidebar_label:"Subquery limit"},l=void 0,s={unversionedId:"release-info/migr-subquery-limit",id:"release-info/migr-subquery-limit",title:"Migration guide: Subquery limit",description:"\x3c!--",source:"@site/docs/latest/release-info/migr-subquery-limit.md",sourceDirName:"release-info",slug:"/release-info/migr-subquery-limit",permalink:"/docs/latest/release-info/migr-subquery-limit",draft:!1,tags:[],version:"current",frontMatter:{id:"migr-subquery-limit",title:"Migration guide: Subquery limit",sidebar_label:"Subquery limit"},sidebar:"docs",previous:{title:"Front-coded dictionaries",permalink:"/docs/latest/release-info/migr-front-coded-dict"},next:{title:"MVDs to arrays",permalink:"/docs/latest/release-info/migr-mvd-array"}},m={},d=[{value:"Row-based subquery limit",id:"row-based-subquery-limit",level:2},{value:"Enable a byte-based subquery limit",id:"enable-a-byte-based-subquery-limit",level:2},{value:"Usage considerations",id:"usage-considerations",level:2},{value:"Learn more",id:"learn-more",level:2}],p={toc:d},c="wrapper";function b(e){var t=e.components,r=(0,i.Z)(e,a);return(0,o.kt)(c,(0,n.Z)({},p,r,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("p",null,"Druid now allows you to set a byte-based limit on subquery size, to prevent brokers from running out of memory when handling large subqueries.\nDruid uses subqueries as joins as well as in common table expressions, such as WITH."),(0,o.kt)("p",null,"The byte-based subquery limit overrides Druid's row-based subquery limit."),(0,o.kt)("admonition",{type:"info"},(0,o.kt)("p",{parentName:"admonition"},"We recommend that you move towards using byte-based limits starting in Druid 30.0.")),(0,o.kt)("p",null,"For queries that generate a large number of rows (5 million or more), we recommend that you don't use ",(0,o.kt)("inlineCode",{parentName:"p"},"maxSubqueryBytes")," from the outset.\nYou can increase ",(0,o.kt)("inlineCode",{parentName:"p"},"maxSubqueryRows")," and then configure the byte-based limit if you find that Druid needs it to process the query."),(0,o.kt)("h2",{id:"row-based-subquery-limit"},"Row-based subquery limit"),(0,o.kt)("p",null,"Druid uses the ",(0,o.kt)("inlineCode",{parentName:"p"},"maxSubqueryRows")," property to limit the number of rows Druid returns in a subquery.\nBecause this is a row-based limit, it doesn't restrict the overall size of the returned data."),(0,o.kt)("p",null,"The ",(0,o.kt)("inlineCode",{parentName:"p"},"maxSubqueryRows")," property is set to 100,000 by default."),(0,o.kt)("h2",{id:"enable-a-byte-based-subquery-limit"},"Enable a byte-based subquery limit"),(0,o.kt)("p",null,"Set the optional property ",(0,o.kt)("inlineCode",{parentName:"p"},"maxSubqueryBytes")," to set a maximum number of returned bytes.\nThis property takes precedence over ",(0,o.kt)("inlineCode",{parentName:"p"},"maxSubqueryRows"),"."),(0,o.kt)("h2",{id:"usage-considerations"},"Usage considerations"),(0,o.kt)("p",null,"You can set both ",(0,o.kt)("inlineCode",{parentName:"p"},"maxSubqueryRows")," and ",(0,o.kt)("inlineCode",{parentName:"p"},"maxSubqueryBytes")," at cluster level and override them in individual queries.\nSee ",(0,o.kt)("a",{parentName:"p",href:"../configuration#overriding-default-query-context-values"},"Overriding default query context values")," for more information."),(0,o.kt)("h2",{id:"learn-more"},"Learn more"),(0,o.kt)("p",null,"See the following topics for more information:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"/docs/latest/querying/query-context"},"Query context")," for information on setting query context parameters."),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"../configuration#guardrails-for-materialization-of-subqueries"},"Broker configuration reference")," for more information on ",(0,o.kt)("inlineCode",{parentName:"li"},"maxSubqueryRows")," and ",(0,o.kt)("inlineCode",{parentName:"li"},"maxSubqueryBytes"),".")))}b.isMDXComponent=!0}}]); |