Thanks for your questions.
1 Is there any optimization for Cross_join such as predicate optimization;I don't find any optimization in the file of optimizer. And in the file,what does the Optimizer.cpp and L2POptimizer.cpp means to do?I can‘t find any useful messages.
No, not much at the moment, and certainly not as much as we would wish; our efforts have been concentrated elsewhere.
Optimizer.cpp is a place holder for where we plan to add future static optimizations and rewrites, and also handles the introduction of 'hidden' calls to 'sg' and the generation of the physical operator plan that we actually execute - our 'code generator', in a sense.
[i]2 Or is there any cost estimation of Cross_join?Or have you ever do some cost estimation about other operations?
Again, no, although there are a handful of rather specific and ad hoc such optimizations that are implemented.
3 What does "sg" mean?
'Scatter-Gather' is an internal operator that we use to redistribute chunks across instances within the cluster.
4 What does the files of explainLogical/explainPhyscial and echo mean to do?
They implement a pair of operators 'explain_logical' and 'explain_physical' that convert the string representation of a query into a single element array whose string value is a diagnostic dump of the logical / physical query plan. They are used internally (to write to the log, for example).