StarRocks vs. Trino/Presto£º½ÒÃظ߲¢·¢Êý¾Ý·ÖÎöÒýÇæ
2024-07-08 11:25:05
À´Ô´:ÔÆÕƲƾ
ä¯ÀÀ:20´Î
Trino£¨Ö®Ç°³Æ PrestoSQL£©ÏîÄ¿×î³õÓÉ Meta ¿ª·¢£¬Ö¼ÔÚÈÃÊý¾Ý·ÖÎöʦÄܹ»Ôڹ㷺µÄ Apache Hadoop Êý¾Ý²Ö¿âÉÏÖ´Ðн»»¥Ê½²éѯ¡£Æä¸ßЧ´¦Àí´óÐÍÊý¾Ý¼¯ºÍ¸´ÔÓ²éѯµÄÄÜÁ¦£¬ÒÔ¼°¶àÊý¾ÝÔ´Á¬½ÓµÄÁé»îÐÔ£¬Ê¹ÆäѸËÙ³ÉΪ´ó¹æÄ£×éÖ¯µÄÊ×Ñ¡Êý¾Ý·ÖÎö¹¤¾ß¡£ Ëæ×Åʱ¼äµÄÍÆÒÆ£¬Óû§¶ÔÊý¾Ý·ÖÎöµÄÐèÇ󲻶ÏÑݱ䡣Òƶ¯»¥ÁªÍøºÍ SaaS Ó¦ÓõÄÐËÆð£¬ÊµÊ±·ÖÎö±äµÃÖÁ¹ØÖØÒª£¬¹ýÈ¥µÄ¼Ü¹¹ÎÞ·¨Âú×ãÔ½À´Ô½ÑÏ¿ÁµÄÊý¾ÝÐèÇó¡£Òò´Ë£¬Ðí¶àÓû§¿ªÊ¼Ñ°ÕÒÌæ´ú·½°¸¡£ StarRocks ×÷ΪһÖÖÐÂÐ˵ÄÊý¾Ý·ÖÎöÒýÇ棬ÒÔÆä¸ßÐÔÄÜ¡¢¸ß²¢·¢´¦ÀíºÍµÍÑÓ³ÙÌØÐÔ£¬ÕýÔÚÎüÒý΢ÐÅ¡¢Ð¡ºìÊ顢Я³Ì¡¢±´¿ÇµÈ´óÐÍÆóÒµµÄ¹Ø×¢ºÍÓ¦Ó㬳ÉΪÐÂÑ¡Ôñ¡£ ÄÇô£¬StarRocks ¾¿¾¹ÈçºÎ¹¹½¨ÆäÓÅÊÆ£¿Óë Trino Ïà±È£¬ËüÓкÎÒì֮ͬ´¦£¿±¾ÎĽ«´Ó¼¼Êõ½Ç¶È³ö·¢£¬¶Ô±ÈStarRocksÓëTrino/Presto£¬²¢Ì½ÌÖStarRocksÔÚʵ¼ÊÓ¦ÓÃÖеıíÏÖ¡£ Ò»¡¢StarRocks Óë Trino ÏàËÆÖ®´¦ ´ó¹æÄ£²¢Ðд¦ÀíMassively Parallel Processing (MPP) Á½¸öÒýÇ涼²ÉÓà MPP ×÷ΪÆä·Ö²¼Ê½Ö´Ðпò¼Ü£¬ÔÚÕâ¸ö¿ò¼ÜÖУ¬Ò»¸ö²éѯÇëÇó±»²ð·ÖΪÖÚ¶àµÄÂß¼ºÍÎïÀíÖ´Ðе¥Ôª£¬²¢ÔÚ¶à¸ö½ÚµãÉÏͬʱÔËÐС£ÓëÐí¶àÆäËûÊý¾Ý·ÖÎö²úÆ·ÔÚÆä·Ö²¼Ê½¼ÆËã¿ò¼ÜÖÐʹÓÃµÄ scatter-gather ģʽ²»Í¬£¬MPP ¿ÉÒÔÀûÓøü¶àµÄ×ÊÔ´À´´¦Àí²éѯÇëÇó¡£µÃÒæÓÚÕâ¸ö¿ò¼Ü£¬Á½¸öÒýÇ涼¿ÉÒÔÔÚ PB ¼¶µÄÊý¾ÝÉÏʹÓã¬Êý°Ù¸ö´óÐÍÓû§ÒѾÔÚÆäÉú²ú»·¾³ÖÐʹÓÃÁËÕâЩÒýÇæ¡£ »ùÓڳɱ¾µÄÓÅ»¯Æ÷Cost-based Optimizer (CBO) Á½¸öÒýÇ涼ÄÚÖÃÁ˸ßЧµÄ»ùÓڳɱ¾µÄÓÅ»¯Æ÷£¨CBO£©£¬ÕâÔÚ´¦Àí¶à±í Join ²éѯʱÓÈΪ¹Ø¼ü¡£µÃÒæÓÚ CBO£¬ÕâÁ½¸öÒýÇ涼Äܹ»´¦Àí°üÀ¨¸´ÔÓ²éѯ¡¢Join ºÍ¾ÛºÏÔÚÄڵĶàÖÖ SQL ÌØÐÔ¡£´ËÍ⣬Trino ºÍ StarRocks ¶¼Í¨¹ýÁË TPC-H ºÍ¸üÄÑµÄ TPC-DS »ù×¼²âÊÔ£¬Ö¤Ã÷ÁËÁ½Õ߶¼Óм«Îª³öÉ«µÄÐÔÄÜ¡£ Pipeline Ö´Ðпò¼Ü Á½¸öÒýÇ涼ÓÐ Pipeline Ö´Ðпò¼Ü¡£Pipeline Ö´Ðпò¼ÜµÄÖ÷ҪĿ±êÊÇÔöÇ¿²éѯÒýÇæÔÚµ¥»úÉÏÀûÓöàºË×ÊÔ´µÄЧÂÊ£¬ÆäÖ÷Òª¹¦ÄÜ°üÀ¨Èý¸ö·½Ã棺 •½µµÍ²éѯÒýÇæÖи÷ÖÖ¼ÆËã½ÚµãµÄÈÎÎñµ÷¶È³É±¾¡£ •Ìá¸ß CPU ÀûÓÃÂÊ£¬Í¬Ê±´¦Àí²éѯÇëÇó¡£ •×Ô¶¯µ÷Õû²éѯִÐеIJ¢Ðжȣ¬³ä·ÖÀûÓöàºËϵͳµÄ¼ÆËãÄÜÁ¦£¬´Ó¶øÌáÉý²éѯÐÔÄÜ¡£ ANSI SQL Ö§³Ö Á½¸öÒýÇ涼·ûºÏ ANSI SQL£¬·ÖÎöʦ¿ÉÒÔÔÚÈÕ³£¹¤×÷ÖÐʹÓÃËûÃÇ×îÊìϤµÄ²éѯÓïÑÔ£¬¶øÎÞÐè¶îÍâµÄѧϰ³É±¾¡£ÆóÒµ¾³£Ê¹ÓÃµÄ BI ¹¤¾ßÒ²½«·Ç³£ÈÝÒ×µØÓë StarRocks »ò Trino ¼¯³É¡£ ¶þ¡¢StarRocks Óë Trino ¼¼ÊõÇø±ð ÏòÁ¿»¯²éѯÒýÇæ
StarRocks ÊÇ C++ ʵÏÖµÄ Native ÏòÁ¿»¯ÒýÇ棬¶ø Trino ÊÇ Java ʵÏֵģ¬Ê¹ÓÃÁËÓÐÏÞµÄÏòÁ¿»¯¼¼Êõ¡£ÏòÁ¿»¯¼¼Êõ°ïÖú StarRocks ¸ü¸ßЧµØÀûÓà CPU ´¦ÀíÄÜÁ¦¡£StarRocks ¾ßÓÐÒÔÏÂÌص㣺 •¿ÉÒÔ³ä·ÖÀûÓÃÁÐʽÊý¾Ý¹ÜÀíµÄЧÂÊ¡£StarRocks ´ÓÁÐʽ´æ´¢ÖжÁÈ¡Êý¾Ý£¬ÔÚÄÚ´æÖйÜÀíÊý¾ÝµÄ·½Ê½£¬ÒÔ¼°Ëã×Ó´¦ÀíÊý¾ÝµÄ·½Ê½¶¼ÊÇÁÐʽµÄ£¬´Ó¶ø¿ÉÒÔ¸üÓÐЧµØÀûÓà CPU »º´æ£¬Ìá¸ß CPU Ö´ÐÐЧÂÊ¡£ •¿ÉÒÔ³ä·ÖÀûÓà CPU Ö§³ÖµÄ SIMD Ö¸Áî¡£ÕâʹµÃ CPU ¿ÉÒÔÔÚ¸üÉÙµÄʱÖÓÖÜÆÚÄÚÍê³É¸ü¶àµÄÊý¾Ý¼ÆË㣬StarRocks ʹÓÃÏòÁ¿»¯Ö¸Áî¿ÉÒÔ½«ÕûÌåÐÔÄÜÌá¸ß 3-10 ±¶¡£ •¿ÉÒÔ¸üÓÐЧµØѹËõÊý¾Ý£¬´Ó¶ø´ó´ó¼õÉÙÄÚ´æÕ¼Óá£ÕâʹµÃÕâÖÖÀàÐ͵IJéѯÒýÇæ¸üÓÐÄÜÁ¦´¦Àí´óÊý¾ÝÁ¿µÄ²éѯÇëÇó¡£ ÊÂʵÉÏ£¬Trino Ò²ÔÚ̽Ë÷ÏòÁ¿»¯¼¼Êõ¡£Trino °üº¬ SIMD ´úÂ룬µ«Óë StarRocks Ïà±È£¬ÔÚÉî¶ÈºÍ¸²¸ÇÂÊ·½ÃæÂäºó¡£Meta µÄ Velox ÏîÄ¿Ö¼ÔÚʹÓÃÏòÁ¿»¯¼¼ÊõÀ´¼ÓËÙ Trino ²éѯ¡£È»¶ø£¬µ½Ä¿Ç°ÎªÖ¹£¬ºÜÉÙÓй«Ë¾ÔÚÉú²ú»·¾³ÖÐÕýʽʹÓà Velox¡£ ÎﻯÊÓͼ
StarRocks ¾ßÓм¸¸ö Trino ûÓеÄÎﻯÊÓͼ¹¦ÄÜ¡£ÎﻯÊÓͼÊǼÓËÙ²éѯµÄ³£¼ûÓÅ»¯ÊֶΣ¬StarRocks ºÍ Trino ¶¼Ö§³Ö´´½¨ÎﻯÊÓͼ£¬µ«ÊÇ StarRocks Äܹ»£º •×Ô¶¯ÖØд²éѯÒÔÔöÇ¿²éѯÐÔÄÜ¡£StarRocks »á×Ô¶¯Ñ¡ÔñºÏÊʵÄÎﻯÊÓͼÀ´¼ÓËÙ²éѯ£¬Óû§²»ÐèÒªÖØд SQL¡£ •Ö´ÐзÖÇø¼¶±ðµÄÎﻯÊÓͼˢУ¬ÔÚ¼õÉÙ×ÊÔ´ÏûºÄµÄͬʱ£¬ÈÃÓû§ÓµÓиüºÃµÄÐÔÄܺͿÉÀ©Õ¹ÐÔ¡£ •¿ÉÒÔÑ¡Ôñ½«ÎﻯÊÓͼдÈë±¾µØ´ÅÅÌ£¬¶ø²»ÊÇÔ¶³Ì´ÅÅÌ/´æ´¢¡£Óû§¿ÉÒÔÀûÓñ¾µØ´ÅÅ̵ĸßÐÔÄÜ£¬±¾µØ´æ´¢²ÉÓà StarRocks רÓеÄÁÐʽ´æ´¢¸ñʽ£¬¸üºÃµØÖ§³ÖÏòÁ¿»¯²éѯÒýÇæµÄÖ´ÐС£ Trino ĿǰûÓÐÕâЩ¹¦ÄÜ£º •Ã»ÓÐ×Ô¶¯²éѯ¸Äд¹¦ÄÜ¡£Óû§ÐèÒª»¨·Ñ´óÁ¿Ê±¼ä½øÐвéѯÖØд¡£ •ÔÚ±¾µØ´ÅÅÌÉÏдÈëÎﻯÊÓͼµÄÄÜÁ¦¡£ »º´æϵͳ StarRocks »ùÓÚ×ÔÑеÄÊý¾Ý»º´æ¿â£¬Ìṩ¸ßЧµÄÊý¾Ý»º´æ¹¦ÄÜ£º 1.Ö§³ÖÄÚ´æºÍ´ÅÅÌÁ½¼¶ Cache£¬ºÍµ¥´¿µÄ´ÅÅÌ»º´æÏà±È£¬ÔÚÄÚ´æ¹ÜÀíÉϸü¼ÓÁé»î¡¢¿É¿Ø¡£ 2.»ùÓÚ¸ßЧµÄ´ÅÅÌ¿Õ¼ä¹ÜÀí½á¹¹£¬±ÜÃâÁËÐí¶àϵͳ»ùÓÚ¶ÀÁ¢ Block Îļþ¶øµ¼Ö´óÁ¿Êý¾ÝÎļþÔì³ÉµÄÎļþ¾ä±úÕ¼ÓÃÎÊÌâ¡£ 3.»ùÓÚÎļþµÄ¸üÐÂÐÅÏ¢À´½øÐлº´æУÑ飬±ÜÃâ±¾µØ»º´æ¶ÁÈ¡µÄÊý¾ÝºÍÔ¶¶Ë²»Ò»Ö¡£ 4.Ö§³Ö´ÅÅÌ»º´æÊý¾ÝµÄ checksum УÑ飬¿ÉÒÔ±ÜÃâÓÉÓÚ´ÅÅ̹ÊÕϵÈÎÊÌâµ¼Ö¶ÁÈ¡µ½Òì³£Êý¾Ý¡£ 5.Ö§³Ö»º´æ I/O ×ÔÊÊÓ¦¡£Äܹ»ÔÚ I/O ÍÌͽϸßʱ×Ô¶¯½«²¿·ÖÇëÇó·Óɵ½Ô¶¶Ë£¬³ä·ÖÀûÓñ¾µØ´ÅÅ̺ÍÍøÂç´ø¿í£¬Ôö¼ÓÕûÌå I/O ÍÌÍ¡£ 6.»º´æÔ¤Èȹ¦ÄÜ£ºÍ¨¹ý cache select Óï¾ä¶ÔÖ¸¶¨¶ÔÏóµÄÊý¾Ý½øÐе¥´Î»òÕßÖÜÆÚ»º´æÔ¤ÈÈ£¬±ÜÃâÊ×´ÎÀä¶ÁʱµÄÐÔÄÜÎÊÌâ¡£ ÁíÍ⣬ÔÚ 3.3 °æ±¾¼´½«Ö§³Ö£º 1.»º´æ¿Õ¼ä×ÔÊÊÓ¦µ÷Õû¡£Äܹ»¸ù¾Ýµ±Ç°´ÅÅ̵ÄÊ£Óà¿Õ¼ä¶¯Ì¬µ÷Õû»º´æ¿Õ¼ä´óС£¬±£Ö¤µ±´ÅÅÌÊ£Óà¿Õ¼ä½ÏµÍʱ£¬¼°Ê±ÊÍ·Å¿Õ¼ä¸øÆäËû¸ßÓÅÄ£¿é£»¶øµ±´ÅÅÌÊ£Óà¿Õ¼ä½Ï¶àʱ£¬×Ô¶¯Ôö¼Ó»º´æ¿Õ¼ä£¬ÀûÓÃÊ£Óà´ÅÅÌÌáÉý»º´æÃüÖÐÂÊ¡£ 2.¶ÔÖ¸¶¨µÄ»º´æ¶ÔÏóÉèÖÃÓÅÏȼ¶ºÍ TTL¡£Óû§Äܹ»¸ù¾Ýʵ¼ÊÐèÇóÒÔ²»Í¬µÄÓÅÏȼ¶À´»º´æ²»Í¬µÄÊý¾Ý¶ÔÏó¡£ Óë´ËÏà±È£¬Trino µÄ Cache ÉÐδ±»¹ã·º²ÉÓá£StarRocks ÔÚ 3.3 °æ±¾ÖÐµÄ Cache ¹¦ÄÜÒѳÉÊ첢ĬÈÏÆôÓᣠJoin ÐÔÄÜ Trino ºÍ StarRocks ¶¼Ö§³Ö¸´Ô Join ²Ù×÷¡£È»¶ø£¬StarRocks Äܹ»Ìṩ¸ü¸ßµÄÐÔÄÜ¡£ÕâÊÇÒòΪ£¬³ýÁËÏòÁ¿»¯²éѯÒýÇæÍ⣬StarRocks »¹ÓµÓÐһЩÌØÊâµÄ¼¼ÊõÄÜÁ¦¡£ Join ÖØÐÂÅÅÐò£¨Join Reorder£©ÊÇÒ»ÖÖ¿ÉÓÃÓÚÌá¸ßÉæ¼°¶à±í Join µÄÊý¾Ý¿â²éѯÐÔÄܵļ¼Êõ£¬Ëüͨ¹ý¸ü¸Ä Join Ö´ÐеÄ˳ÐòÀ´¹¤×÷¡£ Ö´ÐÐ Join ²éѯµÄ³É±¾È¡¾öÓÚ±»Á¬½ÓµÄ±íµÄ´óСºÍÁ¬½ÓÖ´ÐеÄ˳Ðò£¬Í¨¹ýÖØÐÂÅÅÐò Join£¬¿ÉÒÔÕÒµ½¸ü¸ßЧµÄ Join ¼Æ»®¡£Join ÖØÐÂÅÅÐò¿ÉÒÔÓÉÓÅ»¯Æ÷Ö´ÐУ¬Ò²¿ÉÒÔÓÉÓû§ÊÖ¶¯Ö¸¶¨¡£ÓÅ»¯Æ÷ͨ³£»á³¢ÊÔÖØÐÂÅÅÐò Join ÒÔ×îС»¯²éѯµÄ³É±¾¡£ ÓÐÐí¶à²»Í¬µÄËã·¨¿ÉÓÃÓÚÖØÐÂÅÅÐò Join¡£StarRocks ʵÏÖµÄһЩ×î³£¼ûµÄËã·¨°üÀ¨£º •Ì°ÐÄËã·¨£¨Greedy algorithm£©£ºÌ°ÐÄË㷨ͨ¹ýÖظ´Ñ¡Ôñ¾ßÓÐ×îµÍ Join ³É±¾µÄ±í¶Ô£¬²¢½«ËüÃÇÁ¬½ÓÔÚÒ»ÆðÀ´¹¤×÷¡£ •¶¯Ì¬¹æ»®Ëã·¨£¨Dynamic programming algorithm£©£º¶¯Ì¬¹æ»®Ëã·¨µÄ¹¤×÷ÔÀíÊÇÏȹ¹½¨Ò»¸ö°üº¬Ã¿¶Ô±íµÄÁ¬½Ó³É±¾µÄ±í£¬È»ºó»ùÓڸñíÕÒµ½×îÓÅµÄ Join ¼Æ»®¡£ •Çî¾ÙËã·¨£¨Exhaust algorithm£©£ºÒ»ÖÖÖ´ÐÐÊý¾ÝÁ¬½ÓµÄ¼¼Êõ£¬ÌرðÊÊÓÃÓÚ´óÐÍÊý¾Ý¼¯¡£Ëüͨ¹ý½« Join ²Ù×÷·Ö½âΪ¸üС¡¢¸üÒ×ÓÚ¹ÜÀíµÄÈÎÎñÀ´¹¤×÷¡£ÕâʹµÃÔÏÈÒòÊý¾ÝÁ¿¹ý´ó¶øÎÞ·¨×°ÈëÄÚ´æµÄÊý¾Ý¼¯Ò²ÄÜÖ´ÐÐ Join ²Ù×÷¡£ •×óÉî Join ÖØÐÂÅÅÐò£¨Left-deep join reordering£©£ºÒ»ÖÖÆô·¢Ê½Ëã·¨£¬ÓÃÓÚÓÅ»¯²éѯÖÐµÄ Join ˳Ðò¡£¸ÃË㷨ͨ¹ýµÝ¹é¹¹½¨×óÉî Join Ê÷À´¹¤×÷£¬ÆäÖÐÊ÷ÖеÄÿ¸ö½Úµã´ú±íÒ»¸ö Join ²Ù×÷¡£¸ÃËã·¨´Ó×îСµÄ±í¿ªÊ¼£¬È»ºóµÝ¹éµØ½«ÆäÓëÏÂÒ»¸ö×îСµÄ±íÁ¬½Ó£¬Ö±µ½ËùÓÐ±í¶¼ÒÑÁ¬½Ó¡£ •Join ½áºÏÂÉ£¨Join Associativity algorithm£©£ºÍ¨¹ý¶à±í½áºÏÂÉʵÏÖ Join Reorder£¬Í¬Ê±Ö§³Ö Inner/Semi/Cross/Anti/Outer Join µÄ½áºÏÂÉÔËË㣬ÔÚά¶È±íÖ®¼äÊý¾ÝÁ¿²îÒì´ó£¬¶à¸öά¶È±íºÍÊÂʵ±í¹ØÁªÎ½´ÊÆ¥ÅäÐÔ²»Ò»ÖÂʱ£¬ÄÜ×Ô¶¯µ÷Õû Join ˳ÐòÒÔÌáÉý¼ÆËãÐÔÄÜ¡£ •Join ½»»»Ëã·¨£¨Join Commutativity algorithm£©£ºÒ»ÖÖÓÅ»¯²éѯÖÐ Join ˳ÐòµÄ¼¼Êõ£¬Í¨¹ýÀûÓà Join µÄ½»»»ÐÔÊôÐÔÀ´¹¤×÷£¬¸ÃÊôÐÔÖ¸³ö¿ÉÒÔÔÚ²»Ó°Ïì½á¹ûµÄÇé¿öϸü¸Ä Join ²Ù×÷ÊýµÄ˳Ðò¡£ StarRocks Ïà½ÏÓÚ Trino£¬ÌṩÁ˸ü·á¸»µÄ Join ʵÏÖËã·¨¡£Ëü¸ù¾Ý Join ½ÚµãµÄÊýÁ¿£¬²ÉÓò»Í¬µÄ Join Reorder ²ßÂÔ£ºÔÚ½Úµã½ÏÉÙʱ£¬²ÉÓÃö¾Ù·¨£»µ±½ÚµãÊý²»³¬¹ý 10 ¸öʱ£¬Ê¹Óö¯Ì¬¹æ»®ºÍÌ°ÐÄËã·¨£»¶øµ±½ÚµãÊý³¬¹ý 10 ¸öʱ£¬½öʹÓÃÌ°ÐÄËã·¨¡£ÕâÖÖ¶àÑù»¯µÄËã·¨Ó¦Óã¬Ê¹µÃ StarRocks ÔÚ Join ½Úµã½ÏÉÙʱÄܹ»ÕÒµ½×îÓÅÖ´Ðмƻ®£¬ÔÚ½Úµã½Ï¶àʱҲÄÜ¿ìËÙÉú³É¸ßЧµÄÖ´Ðмƻ®¡£ ΪÁËÈ·±£Ö´Ðмƻ®²»½öÔÚµ¥»úÉÏÊÇ×îÓŵģ¬StarRocks »¹±£ÁôÁ˶àÖÖËã·¨Éú³ÉµÄ Join ˳Ðò£¬ÒÔ±ãÓÚÔÚ Memo ½á¹¹ÖÐÑ°ÕÒµ½·Ö²¼Ê½»·¾³ÏµÄ×îÓÅÖ´Ðмƻ®¡£ ¸ß¿ÉÓÃÐÔ StarRocks ÓÐÁ½ÖÖÀàÐ͵Ľڵ㣬ÿÖֽڵ㶼Äܹ»Í¨¹ýÌض¨µÄ²ßÂÔʵÏָ߿ÉÓá£Ç°¶Ë £¨FE£©½ÚµãÊÇÎÞ״̬µÄ£¬¿ÉÒÔͨ¹ý²¿ÊðÆæÊý¸öÇ°¶Ë½ÚµãÀ´ÊµÏָ߿ÉÓ㬽ڵãÖ®¼äʹÓà Raft ÐÒé½øÐÐ leader Ñ¡¾Ù£»ºó¶Ë£¨BE£©½ÚµãÖ§³Ö¶à¸±±¾»úÖÆ£¬±£Ö¤ÈκÎÒ»¸ö½ÚµãµÄ¹ÊÕ϶¼²»»áÓ°ÏìϵͳµÄÔËÐС£Òò´Ë StarRocks ¿ÉÒÔʵÏÖϵͳµÄÈÈÉý¼¶£¬ÔÚϵͳÉý¼¶Æڼ䣬ϵͳµÄÔÚÏß·þÎñ²»»áÊܵ½Ó°Ïì¡£ Trino ûÓÐÄÚÖõĸ߿ÉÓÃÐÔ£¨HA£©Ö§³Ö¡£Trino µÄе÷Æ÷ÊÇϵͳÖеĵ¥µã¹ÊÕÏ£¬Èç¹ûÕâ¸ö½Úµã·¢Éú¹ÊÕÏ£¬Õû¸öϵͳ¾Í»á±äµÃ²»¿ÉÓá£ÕâÒâζ×Åÿµ±ÏµÍ³Éý¼¶Ê±£¬Trino µÄÔÚÏß·þÎñ¶¼ÐèҪֹͣһ¶Îʱ¼ä¡£µ½Ä¿Ç°ÎªÖ¹£¬Trino ÏîÄ¿»¹Ã»ÓÐÌṩ½â¾öÕâ¸öÎÊÌâµÄ·½°¸¡£ Êý¾ÝÔ´ºÍ¿ª·Å±í¸ñʽ ×÷Ϊ Data Mesh ¸ÅÄîµÄ³«µ¼Õߣ¬Trino ÉçÇøÒ»Ö±ÖÂÁ¦ÓÚÕûºÏ¸ü¶àµÄÊý¾ÝÔ´¡£µ½Ä¿Ç°ÎªÖ¹£¬Trino ÒѾ¿ª·¢ÁË 60 ¶à¸ö²»Í¬µÄÁ¬½ÓÆ÷£¬ÊµÏÖÁËÓë¸÷ÖÖÊý¾ÝÔ´µÄÁ¬½Ó£¬°üÀ¨¹ØϵÐÍÊý¾Ý¿â¡¢Êý¾ÝºþµÈ¡£ÕâʹµÃ Trino ¿ÉÒÔ×÷ΪÆóÒµµÄͳһ²éѯÒýÇ棬´Ù½ø¶ÔÀ´×Ô²»Í¬À´Ô´µÄÊý¾Ý½øÐÐÁªºÏ·ÖÎö¡£Õâ¶ÔÓÚÓµÓжà¸öÒµÎñºÍ¶àÑù»¯Êý¾ÝÔ´µÄ´óÐÍÆóÒµÌرðÓÐÓá£Ä¿Ç°£¬StarRocks ¸üרעÓÚ²éѯ Open Data Lakes£¬¶øÆäËûÊý¾ÝÔ´µÄÁ¬½ÓÆ÷½ÏÉÙ¡£
StarRocks Ö§³Ö Apache Iceberg¡¢Apache Hudi¡¢Apache Hive ¡¢Apache Paimon ºÍ Delta Lake µÄ¶ÁÈ¡¡£StarRocks ¾ßÓÐÒ»¶¨µÄ Apache Iceberg/Hive дÈëÄÜÁ¦¡£´ÓÏÂÎÄµÄ Benchmarks ¿É¼û£¬ StarRocks ×÷ΪÊý¾ÝºþµÄ²éѯÒýÇæ¸ü¿ì¡£Trino Ö§³Ö Apache Iceberg¡¢Apache Hudi¡¢Apache Hive ºÍ Delta Lake µÄ¶ÁÈ¡ºÍдÈë¡£¸ù¾Ý StarRocks µÄ Roadmap£¬¿ª·ÅÊý¾ÝºþµÄдÈëÄÜÁ¦½«ºÜ¿ìµÃµ½ÔöÇ¿¡£ Èý¡¢BenchmarkssÊý¾Ý¼¯²âÊÔ½á¹û ²ÉÓà TPC-DS1TB Êý¾Ý¼¯½øÐвâÊÔ£¬·Ö±ðʹÓà StarRocks ºÍ Trino ²éѯÒÔ Apache Iceberg ±í¸ñʽ´æ´¢µÄ Parquet ÎļþµÄÏàͬÊý¾Ý¸±±¾£¬½á¹ûÊÇ StarRocks µÄÕûÌå²éѯÏìӦʱ¼ä±È Trino ¿ì 5.54±¶¡£
ËÄ¡¢»ùÓÚ StarRocks ¹¹½¨ºþ²ÖÒ»Ìå¼Ü¹¹£¨Lakehouse£© »ùÓÚ StarRocks ´æËã·ÖÀë¼Ü¹¹£¬ÒÔ¼°ÎﻯÊÓͼ¡¢¼«ËÙºþ²Ö·ÖÎöµÈ¶ÀÌصļ¼ÊõÌØÐÔ£¬¿ÉÒÔ°ïÖúÓû§¸ü·½±ãµÄ¹¹½¨ Lakehouse¡£»ùÓÚͳһ¿ª·ÅµÄÊý¾Ýºþ´æ´¢£¬²ÉÓà StarRocks Ö±½Ó²éѯÊý¾Ýºþ£¬¿ÉÒÔʵÏÖæÇÃÀÊý¾Ý²Ö¿âµÄÐÔÄÜ£¬Ê¹µÃÐí¶àÒµÎñÓ¦ÓÿÉÒÔÖ±½Ó¹¹½¨ÔÚÊý¾ÝºþÉÏ£¬ÎÞÐ轫Êý¾Ýµ¼ÈëÊý²Ö½øÐзÖÎö¡£ ÔÚһЩÃæÏòÓû§µÄÊý¾Ý·ÖÎö³¡¾°ÖУ¬ÐèÒª¸üµÍµÄ²éѯÑӳٺ͸ü¸ßµÄ²éѯ²¢·¢£¬StarRocks µÄÎﻯÊÓͼ¿ÉÒÔ·¢»ÓÖØÒª×÷Óã¬ÊµÏÖ°´ÐèµÄ½¨Ä£¼ÓËÙ¡£ÎﻯÊÓͼ²»½öÀûÓüÆËã½ÚµãµÄ±¾µØ´æ´¢¼ÓËÙÏà¹Ø²éѯ£¬ÆäÊý¾Ý¸üÐÂÊÇ×Ô¶¯µÄ£¬ÎÞÐèÈ˹¤¸ÉÔ¤¡£´ËÍ⣬ÎﻯÊÓͼµÄ×Ô¶¯ÖØд¹¦ÄÜÔÊÐíÓû§ÔÚ²»ÖØдÈκΠSQL µÄÇé¿öÏÂÏíÊÜÊÓͼµÄ¼ÓËÙЧ¹û¡£
Îå¡¢StarRocksÓû§°¸Àý µ±ÆóÒµÓµÓжà¸öÊý¾ÝÔ´£¬ÐèÒªÒÔͳһµÄ·½Ê½·ÖÎöÕâЩÀ´Ô´µÄÊý¾Ýʱ£¬Trino ÊÇÒ»¸öºÏÊʵÄÑ¡Ôñ¡£Óë Trino Ïà±È£¬Ê¹Óà StarRocks ¿Í»§¿ÉÒÔÇáËÉʵÏÖ¸ü¸ßÐÔÄܵIJéѯÌåÑé¡£½ÓÏÂÀ´£¬ÎÒÃǽ«Ì½ÌÖһЩÓû§Ñ¡Ôñ StarRocks ×÷ΪÌæ´ú Trino/Presto µÄʵ¼Ê°¸Àý¡£ StarRocks ÔÚСºìÊé×ÔÖú·ÖÎö³¡¾°µÄÓ¦ÓÃÓëʵ¼ù ÔÚ×ÔÖú·ÖÎö³¡¾°Ï£¬ÒÔÇ°²ÉÓÃÁË Presto À´ÓÅ»¯ÕûÌåµÄ²éѯÐÔÄÜ£¬µ«ÊÇËæ×ÅСºìÊé×ÔÖú·ÖÎö³¡¾°ÐèÇóµÄ²»¶ÏÔö³¤£¬Presto ÒѲ»ÄÜÂú×ãÈÕÒæÔö³¤µÄ½µ±¾ÔöЧÐèÇó¡£ÔÚ Adhoc ³¡¾°Ï£¬Presto ÉÏÓöµ½Á˼¸¸öÎÊÌ⣺Presto µÄÐÔÄÜÓÅ»¯À§ÄÑ£»Presto µÄÖ÷´Óģʽ»¹´æÔÚµ¥µã¹ÊÕÏÎÊÌ⣬ÓÐDZÔÚµÄÎȶ¨ÐÔ·çÏÕ¡£ ×îÖÕСºìÊé OLAP ÍŶӾö¶¨´Ó Presto ǨÒƵ½ StarRocks ÉÏ¡£ÔÚ»ùÓÚʵ¼ÊÒµÎñ½øÐÐÑé֤ʱ£¬´ÓÏßÉϹýÈ¥µÄʵ¼Ê²éѯÖгéÈ¡ 3000 ¸ö²éѯ£¬·Ö±ð½øÐÐÁË´®ÐÐ 10 ²¢·¢¡¢20 ²¢·¢¡¢30 ²¢·¢µÄѹÁ¦²âÊÔ¡£¶Ô±È Presto£¬96% µÄ²éѯ¶¼Óзdz£Ã÷ÏÔµÄÐÔÄÜÓÅ»¯Ð§¹û¡£Í¬Ê±£¬ÔÚËùÓеIJ¢·¢¶ÈÏ£¬StarRocks µÄ²éѯÐÔÄÜÏà±È Presto ¶¼ÓÐ 4 ±¶ÒÔÉϵÄÌáÉý¡£ ΢ÐÅ»ùÓÚ StarRocks µÄºþ²ÖÒ»Ìåʵ¼ù ʵÏÖºþ²ÖÒ»ÌåµÄÆäÖÐÒ»ÖÖ¼¼Êõ·ÏßÊǺþÉϽ¨²Ö£¬¼´ÔÚÊý¾Ýºþ»ù´¡ÉÏʵÏÖÊý²ÖµÄ¹¦ÄÜ£¬´úÌ洫ͳÊý²Ö£¬¹¹½¨ Lakehouse¡£ÔÚ΢ÐÅÄÚ²¿£¬ºþÉϽ¨²ÖµÄ¼Ü¹¹¾ÀúÁË´Ó Presto + Hive µ½ StarRocks + Iceberg µÄÑݱä¹ý³Ì£¬Í¨¹ýʹÓà StarRocks Ìæ´ú Presto£¬Êý¾ÝµÄʱЧÐÔ´ÓСʱ/Ì켶Ìá¸ßµ½ÁË·ÖÖÓ¼¶£¬Í¬Ê±²éѯЧÂÊ´Ó·ÖÖÓ¼¶Ìá¸ßµ½ÁËÃ뼶/·ÖÖÓ¼¶£¬ÆäÖÐ80%µÄ´ó²éѯÓà StarRocks ½â¾ö£¬Ã뼶·µ»Ø£¬Ê£Ïµij¬´ó²éѯͨ¹ý Spark À´½â¾ö¡£Óë Presto Ïà±È£¬StarRocks Ö±½Ó²éºþµÄÐÔÄÜÌáÉý 3-6 ±¶ÒÔÉÏ¡£ StarRocks ´æËã·ÖÀëÖúÁ¦ÔÆÀÀ¿Æ¼¼ÒµÎñ³öº£ ÒÔÇ°ÔÆÀÀ¿Æ¼¼ OLAP ʹÓÃÁË Trino¡¢ClickHouse¡¢StarRocks¡£ÆäÖУ¬Trino ¸øÒµÎñͬѧÌṩ¼´Ï¯²éѯÓÃ;£¬µ±²¢·¢Á¿´ó¡¢´ó²éѯ¶àʱ£¬Trino ºÜÈÝÒ׳öÏÖÄÚ´æÒç³ö£¬Îȶ¨ÐÔ²»×㣬Ŀǰͳ¼ÆÏßÉϲéѯʧ°ÜµÄÇé¿öÔ¼ÓÐ10%×óÓÒÓÉÄÚ´æÒç³öµ¼Ö¡£ClickHouse ÔòÎÞ·¨´¦Àí¸ß²¢·¢³¡¾°£¬ºÜÈÝÒ×Òò CPU ´òÂúµ¼Ö·þÎñÖØÆô¡£StarRocks ÉçÇøÔÚ 3.0.0 °æ±¾ÍƳöÁË´æËã·ÖÀë°æ±¾ºó£¬ÔÆÀÀ¿Æ¼¼µÚһʱ¼ä½øÐÐÁ˵÷ÑвâÆÀ£¬ÔÚºóÐøµÄ´æËã·ÖÀëʵ¼ùÖУ¬½µ±¾ÔöЧÊÕÒæÏÔÖø£¬Êý¾ÝÍŶÓÒѼƻ®»ùÓÚ StarRocks ʵÏÖÒ»Ì× Lakehouse мܹ¹£¬È¥µôµ±Ç°¶àÌ× OLAP ·þÎñ£¬Ö»±£Áô StarRocks ×÷Ϊ¼ÆËãÒýÇ棬½ÚÔ¼´óÁ¿¼ÆËã×ÊÔ´¡£ 10±¶ÐÔÄÜÌáÉý£¡Ð¯³ÌµÄͳһ·ÖÎöÖ®Âà Artnova ÊÇЯ³ÌÄÚ²¿Í³Ò»µÄ±¨±íƽ̨£¬×Ô 2022 ÄêÆð£¬Ð¯³Ì¾Í¿ªÊ¼²ÉÓà StarRocks ×÷Ϊ¼ÓËÙ Artnova ±¨±íµÄÐÂÒýÇ棬µÚÒ»½×¶Î°Ñ StarRocks µ±×÷ OLAP Êý¾Ý¿âʹÓã¬Ö»Ñ¡È¡ÁË×îÖØÒª¡¢ÐÔÄÜ×îÐèÒªÌáÉýµÄÒµÎñ½øÐÐÁËǨÒÆ£¬Ê£ÓàÒµÎñÈÔ¾Éͨ¹ý Trino À´½øÐкþÉϲéѯ¼ÓËÙ¡£3.0 °æ±¾·¢²¼Ö®ºó£¬StarRocks ²»½öÔÚ²éºþµÄÐÔÄÜ¡¢Îȶ¨ÐÔÉϽøÐÐÁËÔöÇ¿£¬Íâ±íÎﻯÊÓͼµÄÄÜÁ¦¸üÊÇÈÃÈËÑÛÇ°Ò»ÁÁ£¬¶øÇÒÉçÇø»¹Ö§³ÖÁË Trino µÄÓï·¨£¬´ó´ó½µµÍÁËǨÒÆÃż÷¡£¸ù¾ÝЯ³ÌÊý¾ÝÍŶӵIJâÊÔ£¬StarRocks ÔÚÖ±½Ó²éºþµÄÐÔÄÜÉϷdz£ÓÅÒ죬ÔÚ¿ªÆô Data Cache ºóÐÔÄÜÊÇ Trino µÄ 7 ±¶£¬Ä³Ð©³¡¾°Ï´´½¨ÎﻯÊÓͼºóÉõÖÁÓм¸Ê®±¶ÐÔÄÜÌáÉý¡£´ËÍ⣬ʹÓÃÉú²ú SQL ·´¸´²âÊԵóöÆäÄÚÖÃÓï·¨¼æÈÝÐÔÒѾ³¬¹ý 99%£¬±ÈÀý·Ç³£Ö®¸ß¡£Òò´ËЯ³Ì¿ªÊ¼³ÖÐøÍƶ¯´æÁ¿ Trino ²éѯǨÒƵ½ StarRocks Íâ±í+ÎﻯÊÓͼµÄ²éѯ·½Ê½¡£ â¹ûTV »ùÓÚ StarRocks µÄÔÆÔÉúºþ²Ö¼Ü¹¹Éý¼¶ ×Ô 2018 ÄêÆð£¬Ã¢¹ûTV È«Ãæ²ÉÓà Hadoop ¼Ü¹¹£¬²¢ÒýÈë Trino ×÷ΪÖ÷ÒªµÄ²éѯÒýÇ棬ÒÔÂú×ã¸÷ÖÖÊý¾ÝÐèÇó¡£È»¶ø£¬Ëæ×Åƽ̨½ÓÈëµÄÒµÎñÔ½À´Ô½¶à£¬Êý¾ÝÁ¿Ô½À´Ô½´ó£¬ÒµÎñ·ÖÎöÐèÇóÒ²±äµÃ¸ü¼Óʵʱ¡¢¸ü¼Ó¸´ÔӺ;«Ï¸£¬Trino µÄÐÔÄÜÖð½¥³öÏÖÆ¿¾±¡£ÔÚ 2022 Äê 11 Ô£¬Ã¢¹û TV ¿ªÊ¼ÁË OLAP µü´úÑ¡Ð͹¤×÷£¬²¢×îÖÕÑ¡ÔñÁË EMR StarRocks ÓëÏßÉ쵀 Trino »·¾³½øÐÐÁËÐÔÄܱȶԲâÊÔ¡£¸ù¾Ý²âÊÔ£¬ÔÚ×ÊÔ´Ïà²îºÜ¶à¡¢ÇÒûÓдò¿ª Data Cache µÄÇé¿öÏ£¬StarRocks µÄÐÔÄÜ»¹Ã÷ÏÔÓÅÓÚ Trino£¬Æ½¾ùЧÂÊÊÇÔÓÐµÄ 2-3 ±¶¡£Ç¨ÒƳɱ¾ÉÏ£¬StarRocks ¼æÈÝ Trino Óï·¨£¬¸ü¼ÓÒ×ÓÚǨÒÆ¡£ÎÒÃǽ« Trino µÄÀúÊ· SQL ½øÐÐÁ˻طţ¬SQL Óï·¨¼æÈݳ̶ȵ½´ïÁË 90%¡£Òò´Ëâ¹û TV ¾ö¶¨×îÖÕÑ¡Ôñ StarRocks ×÷ΪеÄͳһ·ÖÎöÒýÇæ¡£ 10 ±¶ÐԼ۱ȣ¬ÍòÎïÐÂÉú»ùÓÚ StarRocks ÎÞ·ìÖ±Ìæ Trino£¡ ÔÚ¾ÀúÁË MySQL¡¢Greenplum¡¢Trino µÈ¶àÖּܹ¹Ö®ºó£¬ÎªÁËÔÚ²»½øÐÐÀ©ÈݵÄÇ°ÌáϽøÒ»²½ÔöÇ¿Óû§µÄ²éѯÌåÑ飬²¢Ìá¸ßÕû¸ö·þÎñµÄÐԼ۱ȣ¬ÍòÎïÐÂÉúÒýÈëÁË StarRocks¡£¸ù¾ÝÍòÎïÐÂÉúÔÚÕæʵҵÎñ³¡¾°ÖеIJâÊÔ£¬StarRocks µÄ²éѯÐÔÄÜÕûÌåÓÅÓÚ Trino¡£ÔÚ´®ÐвâÊÔÖУ¬StarRocks µÄÐÔÄÜÊÇ Trino µÄ 6.77 ±¶£¬ÔÚ 10 ²¢ÐвâÊÔÖÐÊÇ Trino µÄ 10.96 ±¶£¬ÔÚ 20 ²¢ÐвâÊÔÖÐÊÇ Trino µÄ 16.03 ±¶¡£ StarRocks ÔÚ±´¿ÇÕÒ·¿µÄ¼«ËÙͳһʵ¼ù ±´¿ÇÄÚ²¿µÄ BI ²úÆ· ODIN ·ÖÎöƽ̨ÖÐÌṩ»ùÓÚ Hive µÄ·ÖÎöÄÜÁ¦£¬µ×²ãͨ¹ý Presto ÒýÇæ²éѯ£¬Óû§Í¨¹ý PrestoSQL ½øÐн¨Ä£·ÖÎö£¬Ä£ÐͺÍÒýÇæñîºÏ·Ç³£½ôÃÜ£¬ÎÞ·¨ÇáÒ×µÄת»»³Éµ½ÆäËûÒýÇæµÄ²éѯ¡£StarRocks Ö§³ÖÁË Hive Íâ±íµÄ¹¦ÄÜ£¬Í¬Ê±Ïà±È Presto ÓÐ 3 ±¶ÒÔÉϵÄÐÔÄÜÌáÉý£¬Ê¹µÃ StarRocks ÔÚ±´¿ÇÓÐÄÜÁ¦Í³Ò» OLAP ³¡¾°¡£Ä¿Ç°ÒÑ¿ªÊ¼½«·ÖÁ÷µ½ StarRocks ×ö²âÊÔÑéÖ¤£¬ºóÐøËæ×Å StarRocks Trino/Presto ¼æÈÝÄÜÁ¦µÄ½øÒ»²½ÌáÉý£¬»á¼ÌÐøÌáÉý StarRocks µÄÁ÷Á¿Õ¼±È£¬ÊµÏÖ StarRocks ÔÚ·ÖÎö²ãµÄÍêȫͳһ¡£ ÖÐÐŽ¨Í¶»ùÓÚStarRocks¹¹½¨Í³Ò»²éѯ·þÎñƽ̨ ÖÐÐŽ¨Í¶ÔÚ 2019 Äê´î½¨ÁË»ùÓÚ Hadoop ÌåϵµÄÊý¾Ýºþ£¬½«´óÁ¿ÀúÊ·Êý¾ÝǨÒƵ½ Hadoop ÉÏ£¬Óà Hive ¶ÔÊý¾Ý½øÐмӹ¤´¦Àí£¬ËùÓеIJéѯ¼ÆË㶼ͨ¹ý Presto Ö´ÐС£µ«ÊÇ£¬¸Ã·½°¸ÔÚ×î½üÁ½ÄêÊý¾ÝÁ¿¿ìËÙÔö³¤¡¢ÒµÎñ³¡¾°¶àÑù»¯·¢Õ¹µÄÇ÷ÊÆÏÂÖð½¥ÎÞ·¨ÊÊÓ᣾ßÌå¶øÑÔ£¬Presto ÔÚ´óÊý¾ÝÁ¿¡¢¶à±í¹ØÁª²éѯʱ»á³öÏÖÏìÓ¦±È½ÏÂý£¬ÉõÖÁÎÞ·¨»ñµÃ²éѯ½á¹ûµÄÎÊÌ⣬ÎÞ·¨Âú×ãµ¥±í¼°¶à±í¸´ÔÓ²éѯ³¡¾°ÏÂÏìÓ¦µÄ¼°Ê±ÐÔ¡£´ËÍ⣬ Presto ÒòΪ×ÊÔ´¸ôÀë²»×ã»á³öÏÖÓ¦ÓÃÇÀÕ¼×ÊÔ´µÄÇé¿ö£¬²»ÄܺܺÃÖ§³Ö¸ß²¢·¢µÄ²éѯÇëÇ󡣺óÀ´£¬ÖÐÐŽ¨Í¶Ñ¡ÔñÒýÈë StarRocks À´¹¹½¨Í³Ò»µÄ²éѯ·þÎñƽ̨£¬Âú×ã¸÷²¿ÃŵÄÓÃÊýÐèÇó¡£²ÉÓà StarRocks ÄÚ²¿±í¼ÓËÙÃ÷ϸÊý¾Ý¹ØÁª²éѯ£¬ÊµÏÖÁËÉÏÒÚ¼¶±ðÊý¾ÝÁ¿´ó±í¹ØÁªÃ뼶ÏìÓ¦£¬ÄÚ±í²éѯЧÂÊÌáÉý10±¶ÒÔÉÏ£¬Íâ±í²éѯЧÂÊÌáÉý1±¶ÒÔÉÏ£¬ÍêÈ«Âú×ã´óÊý¾ÝÁ¿Ï²éѯ·ÖÎö¼°Ê±ÏìÓ¦µÄÐèÇó¡£
|
|||||||||||