You've already forked mariadb-columnstore-engine
							
							
				mirror of
				https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
				synced 2025-10-30 07:25:34 +03:00 
			
		
		
		
	fix(rbo,rules,QA): ExistsFilter::transform merges statistics to enable QA for EXISTS expressions.
This commit is contained in:
		| @@ -1182,10 +1182,15 @@ execplan::SCSEP CalpontSelectExecutionPlan::cloneForTableWORecursiveSelectsGbObH | |||||||
|   // Deep copy of column map |   // Deep copy of column map | ||||||
|   for (const auto& entry : fColumnMap) |   for (const auto& entry : fColumnMap) | ||||||
|   { |   { | ||||||
|     // WIP only relevant RCs must be copied |     auto tableAlias = entry.second->singleTable(); | ||||||
|     if (entry.second) |     // TODO We insert multiple times if there are multiple SCs for the same RC. | ||||||
|  |     if (tableAlias && targetTableAlias.weakerEq(*tableAlias)) | ||||||
|     { |     { | ||||||
|       newColumnMap.insert({entry.first, SRCP(entry.second->clone())}); |       auto it = fColumnMap.find(entry.first); | ||||||
|  |       if (it == fColumnMap.end()) | ||||||
|  |       { | ||||||
|  |         newColumnMap.insert({entry.first, SRCP(entry.second->clone())}); | ||||||
|  |       } | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -127,6 +127,9 @@ execplan::ParseTree* ExistsSub::transform() | |||||||
|     return NULL; |     return NULL; | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  |   // Insert column statistics | ||||||
|  |   fGwip.mergeTableStatistics(gwi.tableStatisticsMap); | ||||||
|  |  | ||||||
|   // remove outer query tables |   // remove outer query tables | ||||||
|   CalpontSelectExecutionPlan::TableList tblist; |   CalpontSelectExecutionPlan::TableList tblist; | ||||||
|  |  | ||||||
|   | |||||||
| @@ -441,6 +441,8 @@ execplan::SCSEP createDerivedTableFromTable(execplan::CalpontSelectExecutionPlan | |||||||
|   } |   } | ||||||
|  |  | ||||||
|   { |   { | ||||||
|  |     derivedCSEP->tableAlias(tableAlias, true); | ||||||
|  |  | ||||||
|     auto additionalUnionVec = makeUnionFromTable( |     auto additionalUnionVec = makeUnionFromTable( | ||||||
|         *derivedCSEP, const_cast<execplan::CalpontSystemCatalog::TableAliasName&>(table), ctx); |         *derivedCSEP, const_cast<execplan::CalpontSystemCatalog::TableAliasName&>(table), ctx); | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user