[{"data":1,"prerenderedAt":1547},["ShallowReactive",2],{"content-\u002Fplugins\u002Faio-starrocks\u002Faio-starrocks-best-practices":3,"children-\u002Fplugins\u002Faio-starrocks\u002Faio-starrocks-best-practices":1546},{"id":4,"title":5,"author":6,"body":7,"budget_tier":6,"build_tags":6,"created":6,"description":1537,"document_type":1538,"extension":1539,"game":6,"install":36,"investment_tier":6,"league":6,"meta":1540,"navigation":1541,"patch":6,"path":1542,"plugin":24,"profit_per_hour":6,"ratings":6,"seo":1543,"skills_count":6,"status":6,"stem":1544,"strategy_tier":6,"tags":6,"updated":6,"version":6,"weight":6,"__hash__":1545},"content\u002Fplugins\u002Faio-starrocks\u002Faio-starrocks-best-practices.md","aio-starrocks-best-practices",null,{"type":8,"value":9,"toc":1488},"minimark",[10,37,42,52,58,63,85,88,92,103,108,153,157,225,229,243,247,252,262,267,273,278,284,288,306,308,312,321,325,332,358,362,367,395,399,446,450,539,543,549,553,564,566,570,574,644,648,654,659,679,684,690,696,702,706,712,738,742,768,771,800,802,806,810,860,864,883,887,905,909,917,922,930,936,940,992,996,1017,1019,1023,1027,1047,1051,1098,1102,1107,1113,1118,1124,1129,1135,1139,1159,1165,1175,1177,1181,1195,1199,1202,1208,1213,1227,1233,1236,1242,1266,1270,1276,1298,1302,1305,1311,1314,1340,1342,1346],[11,12,13],"blockquote",{},[14,15,16,17,25,26,25,30,33,34],"p",{},"From plugin ",[18,19,21],"a",{"href":20},"\u002Fplugins\u002Faio-starrocks",[22,23,24],"strong",{},"aio-starrocks"," · ",[27,28,29],"code",{},"v1.0.2",[22,31,32],{},"Install:"," ",[27,35,36],{},"\u002Fplugin install aio-starrocks@aiocean-plugins",[38,39,41],"h1",{"id":40},"starrocks-best-practices","StarRocks Best Practices",[14,43,44,45,51],{},"Official best practices from ",[18,46,50],{"href":47,"rel":48},"https:\u002F\u002Fdocs.starrocks.io\u002Fdocs\u002Fbest_practices\u002Foverview\u002F",[49],"nofollow","docs.starrocks.io\u002Fdocs\u002Fbest_practices\u002F",".",[14,53,54,57],{},[22,55,56],{},"Core design philosophy:"," \"Designing for efficiency does more than improve query speed — it decreases costs by reducing storage, CPU, and object storage API costs.\"",[59,60,62],"h2",{"id":61},"related-skills","Related Skills",[64,65,66,73,79],"ul",{},[67,68,69,72],"li",{},[27,70,71],{},"\u002Faio-starrocks-query-tuning"," — Query performance tuning, EXPLAIN plans, operator metrics, hints",[67,74,75,78],{},[27,76,77],{},"\u002Fstarrocks"," — Query syntax, cluster connections, Grafana integration",[67,80,81,84],{},[27,82,83],{},"\u002Fstarrocks-expert"," — General table types, data loading, query optimization",[86,87],"hr",{},[59,89,91],{"id":90},"_1-partitioning","1. Partitioning",[14,93,94,95,98,99,102],{},"Partitioning enables ",[22,96,97],{},"coarse-grain data pruning"," via partition elimination AND ",[22,100,101],{},"metadata-only lifecycle operations"," (TTL, GDPR deletes, tenant isolation).",[104,105,107],"h3",{"id":106},"partition-key-selection","Partition Key Selection",[109,110,111,120,130,139],"ol",{},[67,112,113,116,117],{},[22,114,115],{},"Time-first"," — If 80%+ of queries filter by time, lead with ",[27,118,119],{},"date_trunc('day', dt)",[67,121,122,125,126,129],{},[22,123,124],{},"Tenant isolation"," — Include ",[27,127,128],{},"tenant_id"," when managing data per-tenant",[67,131,132,135,136],{},[22,133,134],{},"Retention alignment"," — Include columns you'll purge via ",[27,137,138],{},"DROP PARTITION",[67,140,141,144,145,148,149,152],{},[22,142,143],{},"Composite keys"," — Creates ",[27,146,147],{},"#tenants x #days"," partitions — keep total ",[22,150,151],{},"below ~100K"," to avoid FE memory strain",[104,154,156],{"id":155},"granularity-decision","Granularity Decision",[158,159,160,179],"table",{},[161,162,163],"thead",{},[164,165,166,170,173,176],"tr",{},[167,168,169],"th",{},"Granularity",[167,171,172],{},"Best For",[167,174,175],{},"Advantage",[167,177,178],{},"Limitation",[180,181,182,197,211],"tbody",{},[164,183,184,188,191,194],{},[185,186,187],"td",{},"Daily",[185,189,190],{},"BI\u002Freporting",[185,192,193],{},"365 partitions\u002Fyear; simple TTL",[185,195,196],{},"Coarse for sub-day queries",[164,198,199,202,205,208],{},[185,200,201],{},"Hourly",[185,203,204],{},"IoT\u002Fburst workloads",[185,206,207],{},"Hot-spot isolation",[185,209,210],{},"8,700 partitions\u002Fyear",[164,212,213,216,219,222],{},[185,214,215],{},"Weekly\u002FMonthly",[185,217,218],{},"Historical archive",[185,220,221],{},"Minimal metadata",[185,223,224],{},"Less precise pruning",[104,226,228],{"id":227},"sizing-rule","Sizing Rule",[64,230,231,234,237,240],{},[67,232,233],{},"Each partition \u003C= 100GB",[67,235,236],{},"\u003C= 20K tablets per partition (across replicas)",[67,238,239],{},"Total partitions \u003C 100K (FE memory constraint)",[67,241,242],{},"Tablets per BE \u003C 200K",[104,244,246],{"id":245},"ddl-templates","DDL Templates",[14,248,249],{},[22,250,251],{},"Single-tenant clickstream:",[253,254,260],"pre",{"className":255,"code":257,"language":258,"meta":259},[256],"language-sql","CREATE TABLE click_stream (\n  user_id BIGINT, event_time DATETIME, url STRING, ...)\nDUPLICATE KEY(user_id, event_time)\nPARTITION BY date_trunc('day', event_time)\nDISTRIBUTED BY HASH(user_id) BUCKETS xxx;\n","sql","",[27,261,257],{"__ignoreMap":259},[14,263,264],{},[22,265,266],{},"Multi-tenant SaaS (recommended for sales-engine pattern):",[253,268,271],{"className":269,"code":270,"language":258,"meta":259},[256],"CREATE TABLE metrics (\n  tenant_id INT, dt DATETIME, metric_name STRING, v DOUBLE)\nPRIMARY KEY(tenant_id, dt, metric_name)\nPARTITION BY date_trunc('DAY', dt)\nDISTRIBUTED BY HASH(tenant_id) BUCKETS xxx;\n",[27,272,270],{"__ignoreMap":259},[14,274,275],{},[22,276,277],{},"Large-tenant composite (when single tenant > 100GB\u002Fpartition):",[253,279,282],{"className":280,"code":281,"language":258,"meta":259},[256],"CREATE TABLE activity (\n  tenant_id INT, dt DATETIME, id BIGINT, ....)\nDUPLICATE KEY(dt, id)\nPARTITION BY tenant_id, date_trunc('MONTH', dt)\nDISTRIBUTED BY HASH(id) BUCKETS xxx;\n",[27,283,281],{"__ignoreMap":259},[104,285,287],{"id":286},"partitioning-vs-bucketing","Partitioning vs Bucketing",[64,289,290,300],{},[67,291,292,295,296,299],{},[22,293,294],{},"Partitions"," = lifecycle management tools (TTL, DROP PARTITION, GDPR). Enable query-time ",[22,297,298],{},"partition pruning"," — skip entire data blocks.",[67,301,302,305],{},[22,303,304],{},"Buckets"," = parallelism levers. Distribute data within partitions for parallel scan\u002Fingest.",[86,307],{},[59,309,311],{"id":310},"_2-table-clustering-sort-keys","2. Table Clustering (Sort Keys)",[11,313,314],{},[14,315,316,317,320],{},"\"A thoughtful sort-key is the ",[22,318,319],{},"highest-leverage physical-design knob"," in StarRocks.\"",[104,322,324],{"id":323},"why-sort-keys-matter","Why Sort Keys Matter",[14,326,327,328,331],{},"Sort keys deliver ",[22,329,330],{},"compounding benefits"," across write, storage, and read:",[109,333,334,340,346,352],{},[67,335,336,339],{},[22,337,338],{},"I\u002FO elimination"," — Segment and page pruning via min\u002Fmax metadata skips irrelevant data blocks",[67,341,342,345],{},[22,343,344],{},"Point lookups"," — Sparse prefix index enables millisecond queries on leading sort columns",[67,347,348,351],{},[22,349,350],{},"Sorted aggregation"," — Streaming aggregation (2-3x faster) when GROUP BY aligns with sort key",[67,353,354,357],{},[22,355,356],{},"Compression & caching"," — Sorted data improves encoding efficiency and CPU cache locality",[104,359,361],{"id":360},"sort-key-selection-playbook","Sort Key Selection Playbook",[14,363,364],{},[22,365,366],{},"Decision hierarchy:",[109,368,369,383,389],{},[67,370,371,374,375,378,379,382],{},[22,372,373],{},"Equality columns first"," — High-cardinality columns with frequent ",[27,376,377],{},"="," \u002F ",[27,380,381],{},"IN"," filters",[67,384,385,388],{},[22,386,387],{},"Range columns second"," — Timestamps or numeric ranges for temporal\u002Fvalue windows",[67,390,391,394],{},[22,392,393],{},"Aggregation helpers third"," — GROUP BY columns that enable sorted aggregation",[104,396,398],{"id":397},"configuration-rules","Configuration Rules",[158,400,401,411],{},[161,402,403],{},[164,404,405,408],{},[167,406,407],{},"Rule",[167,409,410],{},"Guidance",[180,412,413,426,436],{},[164,414,415,420],{},[185,416,417],{},[22,418,419],{},"Width",[185,421,422,423],{},"3-5 columns max. Wider keys degrade ingest and exhaust the ",[22,424,425],{},"36-byte prefix-index limit",[164,427,428,433],{},[185,429,430],{},[22,431,432],{},"Cardinality order",[185,434,435],{},"Low-cardinality before high-cardinality enhances compression",[164,437,438,443],{},[185,439,440],{},[22,441,442],{},"String columns",[185,444,445],{},"Long strings consume prefix-index bytes, blocking subsequent columns from indexing",[104,447,449],{"id":448},"reference-templates","Reference Templates",[158,451,452,468],{},[161,453,454],{},[164,455,456,459,462,465],{},[167,457,458],{},"Scenario",[167,460,461],{},"Partition",[167,463,464],{},"Sort Key",[167,466,467],{},"Why",[180,469,470,488,506,523],{},[164,471,472,475,480,485],{},[185,473,474],{},"B2C Orders",[185,476,477],{},[27,478,479],{},"date_trunc('day', order_ts)",[185,481,482],{},[27,483,484],{},"(user_id, order_ts)",[185,486,487],{},"User-first filters; then temporal ranges",[164,489,490,493,498,503],{},[185,491,492],{},"IoT Telemetry",[185,494,495],{},[27,496,497],{},"date_trunc('day', ts)",[185,499,500],{},[27,501,502],{},"(device_id, ts)",[185,504,505],{},"Device time-series dominates",[164,507,508,511,515,520],{},[185,509,510],{},"SaaS Multi-Tenant",[185,512,513],{},[27,514,128],{},[185,516,517],{},[27,518,519],{},"(dt, event_id)",[185,521,522],{},"Tenant isolation; dashboard time clustering",[164,524,525,528,531,536],{},[185,526,527],{},"Dimension Lookup",[185,529,530],{},"none",[185,532,533],{},[27,534,535],{},"(dim_id)",[185,537,538],{},"Point lookups only",[104,540,542],{"id":541},"ddl-example","DDL Example",[253,544,547],{"className":545,"code":546,"language":258,"meta":259},[256],"CREATE TABLE telemetry (\n  device_id VARCHAR,\n  ts DATETIME,\n  value DOUBLE\n)\nENGINE=OLAP\nPRIMARY KEY(device_id, ts)\nPARTITION BY date_trunc('day', ts)\nDISTRIBUTED BY HASH(device_id) BUCKETS 16\nORDER BY (device_id, ts);\n",[27,548,546],{"__ignoreMap":259},[104,550,552],{"id":551},"anti-patterns","Anti-Patterns",[64,554,555,558,561],{},[67,556,557],{},"Placing long string columns at the sort-key head (wastes prefix-index bytes)",[67,559,560],{},"Overly wide sort keys (>5 columns)",[67,562,563],{},"Misaligning partition and sort keys (defeating logical pruning order)",[86,565],{},[59,567,569],{"id":568},"_3-bucketing-distribution-strategy","3. Bucketing (Distribution Strategy)",[104,571,573],{"id":572},"quick-decision-framework","Quick Decision Framework",[158,575,576,588],{},[161,577,578],{},[164,579,580,582,585],{},[167,581,458],{},[167,583,584],{},"Choice",[167,586,587],{},"Rationale",[180,589,590,603,616,628],{},[164,591,592,595,600],{},[185,593,594],{},"Stable join\u002Ffilter keys, high cardinality",[185,596,597],{},[22,598,599],{},"Hash",[185,601,602],{},"Enables pruning, colocated joins, local aggregation",[164,604,605,608,613],{},[185,606,607],{},"Write-heavy logs\u002Fevents; multi-tenant",[185,609,610],{},[22,611,612],{},"Random",[185,614,615],{},"Prevents skew, uniform throughput, elastic growth",[164,617,618,621,625],{},[185,619,620],{},"Aggregate\u002FPrimary Key tables",[185,622,623],{},[22,624,599],{},[185,626,627],{},"Only option for these table types",[164,629,630,633,637],{},[185,631,632],{},"Duplicate Key tables needing elasticity",[185,634,635],{},[22,636,612],{},[185,638,639,640,643],{},"Auto-splits when ",[27,641,642],{},"bucket_size"," set",[104,645,647],{"id":646},"hash-bucketing","Hash Bucketing",[253,649,652],{"className":650,"code":651,"language":258,"meta":259},[256],"DISTRIBUTED BY HASH(column1, column2) BUCKETS n\nPROPERTIES (\"colocate_with\" = \"group_name\")\n",[27,653,651],{"__ignoreMap":259},[14,655,656],{},[22,657,658],{},"Key requirements:",[64,660,661,664,670,676],{},[67,662,663],{},"Key must be stable, evenly distributed, high-cardinality",[67,665,666,669],{},[22,667,668],{},"Cardinality rule:"," >= 1000x the number of BE nodes to prevent skew",[67,671,672,675],{},[22,673,674],{},"Tablet sizing:"," Target 1-10 GB per tablet initially",[67,677,678],{},"Tablets > 10GB = compaction efficiency degradation",[14,680,681],{},[22,682,683],{},"Query optimizations enabled:",[253,685,688],{"className":686,"code":687,"language":258,"meta":259},[256],"-- Tablet pruning: single tablet accessed\nSELECT sum(amount) FROM sales WHERE customer_id = 123;\n\n-- Local aggregation: no shuffle phase\nSELECT customer_id, sum(amount) FROM sales GROUP BY customer_id;\n\n-- Colocated join: no network shuffle between BEs\nSELECT c.region, sum(s.amount)\nFROM sales s JOIN customers c USING (customer_id)\nWHERE s.sale_date BETWEEN '2025-01-01' AND '2025-01-31'\nGROUP BY c.region;\n",[27,689,687],{"__ignoreMap":259},[14,691,692,695],{},[22,693,694],{},"Colocated join setup"," (matching key + bucket count required):",[253,697,700],{"className":698,"code":699,"language":258,"meta":259},[256],"CREATE TABLE sales (\n  sale_id BIGINT, customer_id INT, sale_date DATE, amount DECIMAL(10,2))\nDISTRIBUTED BY HASH(customer_id) BUCKETS 48\nPARTITION BY date_trunc('DAY', sale_date)\nPROPERTIES (\"colocate_with\" = \"group1\");\n\nCREATE TABLE customers (\n  customer_id INT, region VARCHAR(32), status TINYINT)\nDISTRIBUTED BY HASH(customer_id) BUCKETS 48\nPROPERTIES (\"colocate_with\" = \"group1\");\n",[27,701,699],{"__ignoreMap":259},[104,703,705],{"id":704},"random-bucketing","Random Bucketing",[253,707,710],{"className":708,"code":709,"language":258,"meta":259},[256],"DISTRIBUTED BY RANDOM\nPROPERTIES (\"bucket_size\" = \"1GB\")  -- Enables auto-split (v3.2+)\n",[27,711,709],{"__ignoreMap":259},[64,713,714,717,723,726,732],{},[67,715,716],{},"Round-robin row assignment (no hash key)",[67,718,719,720,722],{},"Auto tablet splitting when partition grows (requires ",[27,721,642],{},")",[67,724,725],{},"Growth-only — no shrinking",[67,727,728,731],{},[22,729,730],{},"Limitation:"," Duplicate Key tables only",[67,733,734,737],{},[22,735,736],{},"Trade-off:"," No bucket pruning; every query scans all tablets in a partition; no colocated joins",[104,739,741],{"id":740},"operational-maintenance","Operational Maintenance",[64,743,744,753,762],{},[67,745,746,749,750,752],{},[22,747,748],{},"Random:"," Always set ",[27,751,642],{}," (e.g., 1GB) for auto-split",[67,754,755,758,759,722],{},[22,756,757],{},"Hash:"," Monitor tablet size; re-shard before tablets exceed 5-10 GB (",[27,760,761],{},"ALTER TABLE ... BUCKETS n",[67,763,764,767],{},[22,765,766],{},"Both:"," Watch for metadata bloat with excessive tablet counts",[104,769,552],{"id":770},"anti-patterns-1",[109,772,773,779,785,791],{},[67,774,775,778],{},[22,776,777],{},"Low-cardinality hash keys"," — Creates hot tablets and imbalanced writes",[67,780,781,784],{},[22,782,783],{},"Undersizing initial buckets"," — Hampers ingestion parallelism and compaction",[67,786,787,790],{},[22,788,789],{},"Random bucketing for dimensional joins"," — Eliminates locality optimizations",[67,792,793,799],{},[22,794,795,796,798],{},"Ignoring ",[27,797,642],{}," in Random mode"," — Tablets never split; metadata grows unbounded",[86,801],{},[59,803,805],{"id":804},"_4-primary-key-table-tuning","4. Primary Key Table Tuning",[104,807,809],{"id":808},"primary-key-index-types","Primary Key Index Types",[158,811,812,825],{},[161,813,814],{},[164,815,816,819,822],{},[167,817,818],{},"Type",[167,820,821],{},"Recommendation",[167,823,824],{},"Notes",[180,826,827,838,849],{},[164,828,829,832,835],{},[185,830,831],{},"Full in-memory",[185,833,834],{},"NOT recommended",[185,836,837],{},"Excessive memory waste",[164,839,840,843,846],{},[185,841,842],{},"Local disk persistent",[185,844,845],{},"Standard option",[185,847,848],{},"Good for shared-nothing",[164,850,851,854,857],{},[185,852,853],{},"Cloud-native persistent",[185,855,856],{},"Recommended for shared-data",[185,858,859],{},"Avoids disk capacity constraints, eliminates index rebuilds after rebalancing",[104,861,863],{"id":862},"key-design-principles","Key Design Principles",[64,865,866,873,876],{},[67,867,868,869,872],{},"Focus on ",[22,870,871],{},"uniqueness requirements"," during import\u002Fupdates, NOT query acceleration",[67,874,875],{},"Minimize column count and size (default max: 128 bytes)",[67,877,878,879,882],{},"Use ",[27,880,881],{},"ORDER BY"," clause separately for query optimization via sort keys",[104,884,886],{"id":885},"resource-consumption-formula","Resource Consumption Formula",[64,888,889,897],{},[67,890,891,33,894],{},[22,892,893],{},"Storage:",[27,895,896],{},"(key_size + 8 bytes) x row_count x 50%",[67,898,899,33,902],{},[22,900,901],{},"Memory:",[27,903,904],{},"min(l0_max_mem_usage x tablet_count, update_memory_limit_percent x BE_memory)",[104,906,908],{"id":907},"memory-management","Memory Management",[14,910,911,33,914],{},[22,912,913],{},"Monitor:",[27,915,916],{},"http:\u002F\u002Fbe_ip:be_http_port\u002Fmem_tracker?type=update",[14,918,919],{},[22,920,921],{},"Reduce import memory overhead:",[253,923,928],{"className":924,"code":926,"language":927},[925],"language-text","l0_max_mem_usage = \u003Cvalue \u003C 104857600>    # Default 104857600 (100MB)\nskip_pk_preload = true\ntransaction_apply_worker_count = \u003Ccpu_cores - n>\ntransaction_publish_version_worker_count = \u003Ccpu_cores - n>\n","text",[27,929,926],{"__ignoreMap":259},[14,931,932],{},[933,934,935],"em",{},"Trade-off: Reduced memory increases I\u002FO; fewer worker threads slow ingestion",[104,937,939],{"id":938},"performance-balance","Performance Balance",[158,941,942,952],{},[161,943,944],{},[164,945,946,949],{},[167,947,948],{},"Goal",[167,950,951],{},"Configuration",[180,953,954,969,984],{},[164,955,956,959],{},[185,957,958],{},"High freshness + low query latency",[185,960,961,962,965,966],{},"Increase ",[27,963,964],{},"compact_threads","; decrease ",[27,967,968],{},"update_compaction_per_tablet_min_interval_seconds",[164,970,971,974],{},[185,972,973],{},"Good freshness, limited resources",[185,975,976,977,980,981],{},"Raise ",[27,978,979],{},"lake_ingest_slowdown_threshold"," and ",[27,982,983],{},"lake_compaction_score_upper_bound",[164,985,986,989],{},[185,987,988],{},"Good latency, limited resources",[185,990,991],{},"Reduce write frequency; batch larger data loads",[104,993,995],{"id":994},"monitoring","Monitoring",[64,997,998,1007],{},[67,999,1000,33,1003,1006],{},[22,1001,1002],{},"Shared-data:",[27,1004,1005],{},"SHOW PROC '\u002Ftransactions\u002F{db}\u002Frunning'"," for compaction slowdown messages",[67,1008,1009,1012,1013,1016],{},[22,1010,1011],{},"Shared-nothing:"," Monitor ",[27,1014,1015],{},"tablet_max_versions"," threshold before ingestion failures",[86,1018],{},[59,1020,1022],{"id":1021},"_5-authentication-authorization","5. Authentication & Authorization",[104,1024,1026],{"id":1025},"three-layer-access-control","Three-Layer Access Control",[109,1028,1029,1035,1041],{},[67,1030,1031,1034],{},[22,1032,1033],{},"Identity Authentication"," — \"I am who I claim to be\" (user verification)",[67,1036,1037,1040],{},[22,1038,1039],{},"Access Authentication"," — Group\u002Frole-based login eligibility to the cluster",[67,1042,1043,1046],{},[22,1044,1045],{},"Operation Authorization"," — Query execution and data access permissions",[104,1048,1050],{"id":1049},"authentication-methods","Authentication Methods",[158,1052,1053,1068],{},[161,1054,1055],{},[164,1056,1057,1060,1063,1066],{},[167,1058,1059],{},"Method",[167,1061,1062],{},"User Storage",[167,1064,1065],{},"Setup",[167,1067,172],{},[180,1069,1070,1084],{},[164,1071,1072,1075,1078,1081],{},[185,1073,1074],{},"Native User",[185,1076,1077],{},"In-cluster",[185,1079,1080],{},"Manual creation",[185,1082,1083],{},"Small user bases",[164,1085,1086,1089,1092,1095],{},[185,1087,1088],{},"Security Integration",[185,1090,1091],{},"External system",[185,1093,1094],{},"Configuration-driven",[185,1096,1097],{},"Large enterprises",[104,1099,1101],{"id":1100},"configuration-examples","Configuration Examples",[14,1103,1104],{},[22,1105,1106],{},"Native user with external auth (LDAP):",[253,1108,1111],{"className":1109,"code":1110,"language":258,"meta":259},[256],"CREATE USER \u003Cusername> IDENTIFIED WITH authentication_ldap_simple\nAS 'uid=tom,ou=company,dc=example,dc=com';\n",[27,1112,1110],{"__ignoreMap":259},[14,1114,1115],{},[22,1116,1117],{},"Security integration (LDAP):",[253,1119,1122],{"className":1120,"code":1121,"language":258,"meta":259},[256],"CREATE SECURITY INTEGRATION \u003Cname> PROPERTIES (\n    \"type\" = \"authentication_ldap_simple\",\n    \"authentication_ldap_simple_server_host\" = \"\",\n    \"authentication_ldap_simple_server_port\" = \"\",\n    \"authentication_ldap_simple_bind_base_dn\" = \"\",\n    \"authentication_ldap_simple_user_search_attr\" = \"\"\n);\n\nADMIN SET FRONTEND CONFIG (\n    \"authentication_chain\" = \"\u003Csecurity_integration_name>\"\n);\n",[27,1123,1121],{"__ignoreMap":259},[14,1125,1126],{},[22,1127,1128],{},"Group provider + role grants:",[253,1130,1133],{"className":1131,"code":1132,"language":258,"meta":259},[256],"CREATE GROUP PROVIDER \u003Cname> PROPERTIES (\n    \"type\" = \"ldap\",\n    \"ldap_conn_url\" = \"\",\n    \"ldap_bind_root_dn\" = \"\",\n    \"ldap_bind_base_dn\" = \"\"\n);\n\nGRANT \u003Crole> TO EXTERNAL GROUP \u003Cgroup_name>;\n",[27,1134,1132],{"__ignoreMap":259},[104,1136,1138],{"id":1137},"solution-selection","Solution Selection",[64,1140,1141,1147,1153],{},[67,1142,1143,1146],{},[22,1144,1145],{},"Full external control"," — Security Integration + Apache Ranger",[67,1148,1149,1152],{},[22,1150,1151],{},"Minimal setup, native control"," — Security Integration + Internal RBAC",[67,1154,1155,1158],{},[22,1156,1157],{},"Legacy"," — Native users with GRANT statements",[14,1160,1161,1164],{},[22,1162,1163],{},"Supported protocols:"," LDAP, OIDC, OAuth 2.0, JWT, native passwords",[14,1166,1167,1170,1171,1174],{},[22,1168,1169],{},"Critical:"," User IDs and group names ",[22,1172,1173],{},"must match"," across auth, group provider, and authorization systems. Mismatches cause permission failures.",[86,1176],{},[59,1178,1180],{"id":1179},"_6-audit-log-resource-groups","6. Audit Log & Resource Groups",[14,1182,1183,1186,1187,1190,1191,1194],{},[22,1184,1185],{},"Core principle:"," Use ",[22,1188,1189],{},"data-driven resource allocation"," by analyzing ",[27,1192,1193],{},"starrocks_audit_db__.starrocks_audit_tbl__"," rather than guesswork.",[104,1196,1198],{"id":1197},"cpu-resource-allocation","CPU Resource Allocation",[14,1200,1201],{},"Analyze per-user CPU consumption, allocate proportionally:",[253,1203,1206],{"className":1204,"code":1205,"language":258,"meta":259},[256],"-- Aggregate cpuCostNs per user, last 30 days\nSELECT user, SUM(cpuCostNs) \u002F 1e9 AS cpu_seconds\nFROM starrocks_audit_db__.starrocks_audit_tbl__\nWHERE state IN ('EOF', 'OK')\n  AND timestamp >= DATE_SUB(CURRENT_DATE(), INTERVAL 30 DAY)\nGROUP BY user\nORDER BY cpu_seconds DESC;\n",[27,1207,1205],{"__ignoreMap":259},[14,1209,1210],{},[22,1211,1212],{},"Configuration:",[64,1214,1215,1221],{},[67,1216,1217,1220],{},[27,1218,1219],{},"exclusive_cpu_cores"," — Cannot exceed single BE core count; sum across all groups \u003C= BE total",[67,1222,1223,1226],{},[27,1224,1225],{},"cpu_weight"," — For soft-isolation groups; determines relative share on remaining cores",[14,1228,1229,1232],{},[22,1230,1231],{},"Rule of thumb:"," If a user is 16% of CPU on a 64-core BE, allocate ~11 cores.",[104,1234,908],{"id":1235},"memory-management-1",[253,1237,1240],{"className":1238,"code":1239,"language":258,"meta":259},[256],"-- Peak single-query memory per user\nSELECT user, MAX(memCostBytes) \u002F (1024 * 1024) AS peak_mem_mb\nFROM starrocks_audit_db__.starrocks_audit_tbl__\nWHERE state IN ('EOF', 'OK')\n  AND timestamp >= DATE_SUB(CURRENT_DATE(), INTERVAL 30 DAY)\nGROUP BY user;\n",[27,1241,1239],{"__ignoreMap":259},[64,1243,1244,1250,1260],{},[67,1245,1246,1249],{},[27,1247,1248],{},"big_query_mem_limit"," — Set high to avoid false-positive termination of legitimate large queries",[67,1251,1252,1255,1256,1259],{},[27,1253,1254],{},"mem_limit"," — Set high (e.g., ",[27,1257,1258],{},"0.9"," for 90%)",[67,1261,1262,1263],{},"Per-BE usage ~= ",[27,1264,1265],{},"total_max_mem_mb \u002F number_of_BEs",[104,1267,1269],{"id":1268},"concurrency-control","Concurrency Control",[253,1271,1274],{"className":1272,"code":1273,"language":258,"meta":259},[256],"-- Peak concurrent queries per user per minute\nSELECT user, DATE_FORMAT(timestamp, '%Y-%m-%d %H:%i') AS minute_bucket,\n       COUNT(*) AS concurrent_queries\nFROM starrocks_audit_db__.starrocks_audit_tbl__\nWHERE queryType = 'query' AND state IN ('EOF', 'OK')\n  AND timestamp >= DATE_SUB(CURRENT_DATE(), INTERVAL 7 DAY)\nGROUP BY user, minute_bucket\nORDER BY concurrent_queries DESC;\n",[27,1275,1273],{"__ignoreMap":259},[64,1277,1278,1288,1295],{},[67,1279,1280,1283,1284,1287],{},[27,1281,1282],{},"concurrency_limit"," — Set to ",[22,1285,1286],{},"1.5x observed peak"," for headroom",[67,1289,1290,1291,1294],{},"For extreme spikes: enable ",[22,1292,1293],{},"Query Queues"," for load smoothing",[67,1296,1297],{},"Minute-level analysis may underestimate per-second spikes",[104,1299,1301],{"id":1300},"materialized-view-resource-isolation","Materialized View Resource Isolation",[14,1303,1304],{},"Prevent async MV refreshes from degrading interactive queries:",[253,1306,1309],{"className":1307,"code":1308,"language":258,"meta":259},[256],"CREATE RESOURCE GROUP rg_mv (\n    user = 'mv_user',\n    query_type IN ('insert', 'select')\n)\nWITH (\n    'cpu_weight' = '32',\n    'mem_limit' = '0.9',\n    'concurrency_limit' = '10',\n    'spill_mem_limit_threshold' = '0.5'\n);\n\n-- Assign to MV at creation\nCREATE MATERIALIZED VIEW ... PROPERTIES ('resource_group' = 'rg_mv');\n\n-- Or existing MV\nALTER MATERIALIZED VIEW ... SET (\"resource_group\" = \"rg_mv\");\n",[27,1310,1308],{"__ignoreMap":259},[104,1312,552],{"id":1313},"anti-patterns-2",[64,1315,1316,1319,1325,1331,1337],{},[67,1317,1318],{},"Relying on guesswork instead of audit log analysis",[67,1320,1321,1322,1324],{},"Setting ",[27,1323,1219],{}," sum to exceed available BE cores",[67,1326,1327,1328,1330],{},"Using low ",[27,1329,1282],{}," without headroom buffer",[67,1332,1333,1334,1336],{},"Applying low ",[27,1335,1254],{}," that terminates legitimate queries",[67,1338,1339],{},"Allowing MV refreshes to share resources with interactive workloads",[86,1341],{},[59,1343,1345],{"id":1344},"decision-matrix-table-design-by-use-case","Decision Matrix — Table Design by Use Case",[158,1347,1348,1366],{},[161,1349,1350],{},[164,1351,1352,1355,1358,1361,1364],{},[167,1353,1354],{},"Decision",[167,1356,1357],{},"Single-Tenant Fact",[167,1359,1360],{},"Multi-Tenant SaaS",[167,1362,1363],{},"IoT\u002FEvents",[167,1365,527],{},[180,1367,1368,1390,1414,1433,1451,1469],{},[164,1369,1370,1374,1378,1383,1387],{},[185,1371,1372],{},[22,1373,461],{},[185,1375,1376],{},[27,1377,497],{},[185,1379,1380],{},[27,1381,1382],{},"date_trunc('DAY', dt)",[185,1384,1385],{},[27,1386,497],{},[185,1388,1389],{},"None",[164,1391,1392,1396,1401,1406,1410],{},[185,1393,1394],{},[22,1395,464],{},[185,1397,1398],{},[27,1399,1400],{},"(user_id, ts)",[185,1402,1403],{},[27,1404,1405],{},"(tenant_id, dt)",[185,1407,1408],{},[27,1409,502],{},[185,1411,1412],{},[27,1413,535],{},[164,1415,1416,1421,1424,1427,1430],{},[185,1417,1418],{},[22,1419,1420],{},"Distribution",[185,1422,1423],{},"HASH(user_id)",[185,1425,1426],{},"HASH(tenant_id)",[185,1428,1429],{},"RANDOM w\u002F bucket_size",[185,1431,1432],{},"HASH(dim_id)",[164,1434,1435,1440,1443,1446,1449],{},[185,1436,1437],{},[22,1438,1439],{},"Bucket Type",[185,1441,1442],{},"Hash (colocate joins)",[185,1444,1445],{},"Hash (tenant filter pruning)",[185,1447,1448],{},"Random (prevent skew)",[185,1450,599],{},[164,1452,1453,1458,1460,1463,1466],{},[185,1454,1455],{},[22,1456,1457],{},"PK Index",[185,1459,842],{},[185,1461,1462],{},"Cloud-native (elastic)",[185,1464,1465],{},"Cloud-native",[185,1467,1468],{},"Local disk",[164,1470,1471,1476,1479,1482,1485],{},[185,1472,1473],{},[22,1474,1475],{},"Achievement",[185,1477,1478],{},"Query on user; streaming agg",[185,1480,1481],{},"Tenant isolation; fast TTL",[185,1483,1484],{},"Write throughput; device clustering",[185,1486,1487],{},"Millisecond lookups",{"title":259,"searchDepth":1489,"depth":1489,"links":1490},2,[1491,1492,1500,1508,1515,1523,1529,1536],{"id":61,"depth":1489,"text":62},{"id":90,"depth":1489,"text":91,"children":1493},[1494,1496,1497,1498,1499],{"id":106,"depth":1495,"text":107},3,{"id":155,"depth":1495,"text":156},{"id":227,"depth":1495,"text":228},{"id":245,"depth":1495,"text":246},{"id":286,"depth":1495,"text":287},{"id":310,"depth":1489,"text":311,"children":1501},[1502,1503,1504,1505,1506,1507],{"id":323,"depth":1495,"text":324},{"id":360,"depth":1495,"text":361},{"id":397,"depth":1495,"text":398},{"id":448,"depth":1495,"text":449},{"id":541,"depth":1495,"text":542},{"id":551,"depth":1495,"text":552},{"id":568,"depth":1489,"text":569,"children":1509},[1510,1511,1512,1513,1514],{"id":572,"depth":1495,"text":573},{"id":646,"depth":1495,"text":647},{"id":704,"depth":1495,"text":705},{"id":740,"depth":1495,"text":741},{"id":770,"depth":1495,"text":552},{"id":804,"depth":1489,"text":805,"children":1516},[1517,1518,1519,1520,1521,1522],{"id":808,"depth":1495,"text":809},{"id":862,"depth":1495,"text":863},{"id":885,"depth":1495,"text":886},{"id":907,"depth":1495,"text":908},{"id":938,"depth":1495,"text":939},{"id":994,"depth":1495,"text":995},{"id":1021,"depth":1489,"text":1022,"children":1524},[1525,1526,1527,1528],{"id":1025,"depth":1495,"text":1026},{"id":1049,"depth":1495,"text":1050},{"id":1100,"depth":1495,"text":1101},{"id":1137,"depth":1495,"text":1138},{"id":1179,"depth":1489,"text":1180,"children":1530},[1531,1532,1533,1534,1535],{"id":1197,"depth":1495,"text":1198},{"id":1235,"depth":1495,"text":908},{"id":1268,"depth":1495,"text":1269},{"id":1300,"depth":1495,"text":1301},{"id":1313,"depth":1495,"text":552},{"id":1344,"depth":1489,"text":1345},"StarRocks table design best practices — partitioning strategy, sort key selection, bucketing decisions, Primary Key table tuning, authentication\u002Fauthorization, and resource group configuration.","skill","md",{},true,"\u002Fplugins\u002Faio-starrocks\u002Faio-starrocks-best-practices",{"title":5,"description":1537},"plugins\u002Faio-starrocks\u002Faio-starrocks-best-practices","XSMla2mu76L91cVxSTZq5rTcskQ0oIwU6V13iMHdqJE",[],1779707416850]