2020六月·时穷节乃见 一一垂丹青

题记

天地有正气,杂然赋流形。下则为河岳,上则为日星。於人曰浩然,沛乎塞苍冥。

皇路当清夷,含和吐明庭。时穷节乃见,一一垂丹青。在齐太史简,在晋董狐笔。

在秦张良椎,在汉苏武节。为严将军头,为嵇侍中血。为张睢阳齿,为颜常山舌。

或为辽东帽,清操厉冰雪。或为出师表,鬼神泣壮烈。或为渡江楫,慷慨吞胡羯。

或为击贼笏,逆竖头破裂。是气所磅礴,凛烈万古存。当其贯日月,生死安足论。

地维赖以立,天柱赖以尊。三纲实系命,道义为之根。嗟予遘阳九,隶也实不力。

楚囚缨其冠,传车送穷北。鼎镬甘如饴,求之不可得。阴房阗鬼火,春院闭天黑。

牛骥同一皂,鸡栖凤凰食。一朝蒙雾露,分作沟中瘠。如此再寒暑,百疠自辟易。

哀哉沮洳场,为我安乐国。岂有他缪巧,阴阳不能贼。顾此耿耿存,仰视浮云白。

悠悠我心悲,苍天曷有极。哲人日已远,典刑在夙昔。风檐展书读,古道照颜色。

《正气歌》—— 文天祥
Continue reading →

Learning Plan

I am going to take 2-3 years spare time to finish some classical books. Some of them have been half-finished. This job does not conflict with daily work and paper reading.

Programming Languages and Compilers

  • Types and Programming Languages Book by Benjamin C. Pierce
  • Introduction to Automata Theory, Languages, and Computation, Textbook by Jeffrey Ullman and John Hopcroft
  • Essentials of Programming Languages Textbook by Daniel P. Friedman and Mitchell Wand
  • The little series by Dan Friedman
  • Modern Compiler Implementation in ML Textbook by Andrew Appel
  • C Interfaces and Implementations: Techniques for Creating Reusable … Book by David Hanson
  • A Retargetable C Compiler: Design and Implementation Book by Christopher W. Fraser and David Hanson
  • Programming Language Pragmatics Book by Michael L. Scott
Continue reading →

Tour of analyzing of a bug of Greenplum: Locus, Partial Distribution, Motion and Interconnect

Overview

The bad plan and wrong result

When reviewing the code of the PR Improve Append plan when General children exist #9692, I have come to this line of code in the function set_append_path_locus:

/*
 * CDB: If all the scans are distributed alike, set
 * the result locus to match.  Otherwise, if all are partitioned,
 * set it to strewn.  A mixture of partitioned and non-partitioned
 * scans should not occur after above correction;
 *
 * CDB TODO: When the scans are not all partitioned alike, and the
 * result is joined with another rel, consider pushing the join
 * below the Append so that child tables that are properly
 * distributed can be joined in place.
 */
if (isfirst)
{
	targetlocus = projectedlocus;
	isfirst = false;
}
else if (cdbpathlocus_equal(targetlocus, projectedlocus))
{
	/* compatible */
}
else
{
	/*
	 * subpaths have different distributed policy, mark it as random
	 * distributed and set the numsegments to the maximum of all
	 * subpaths to not missing any tuples.
	 */
	CdbPathLocus_MakeStrewn(&targetlocus,
							Max(CdbPathLocus_NumSegments(targetlocus),
								CdbPathLocus_NumSegments(projectedlocus)));
	break;
}
Continue reading →

清华大学云校庆——我和散打队

清华大学校庆云访谈

个人介绍

吕正华,2011年进入清华大学,电子工程系,智能感知实验室攻读硕士学位,2014年毕业。2018年回学校执教散打队摔跤训练。目前在VMware担任分布式数据库Greenplum内核开发工程师,Sr. Member Technical Staff。

研究生期间参加的是太极拳协会,他们的教练跟李宝如先生(散打运动开拓者,新中国早期体育健将,北京市散打队教练,北京市摔跤队教练)熟识,从而我也认识李宝如先生,然后就一直跟着李宝如先生练摔跤和功夫。在学校的时候,就坚持每周都去天坛训练。也结识了很多摔跤、散打的全国冠军、体育健将,跟他们也经常竞技学习。这个人脉也为学校的散打队带来了很多极高水平的运动员来教学。

Continue reading →

Reading Notes: SIGMOD 2019 Revenge of the Interpolation Search

Overview

Recently I spent some time on a paper of SIGMOD 2019. It is a paper that optimizing an old algorithm based on model architecture of computer. We can learn some methods of programming skills to optimize algorithms.

The paper is:

Van Sandt, Peter, Yannis Chronis, and Jignesh M. Patel. “Efficiently Searching In-Memory Sorted Arrays: Revenge of the Interpolation Search?.” Proceedings of the 2019 International Conference on Management of Data. 2019.

Continue reading →

三国赵云传数据+Postgres解析一篇SIGMOD2019论文的agg递归CTE

标题党实锤了。这也是我博客中第一篇用中文写的技术文章。坚持用英文写博客,并不是崇洋媚外,只是为了跟各国同事之间交流技术方便一些。那么这次为啥选择母语,因为原始论文里的例子一点也不好玩,我选择三国赵云传的一个数据来作例子,那不妨就写得幽默一代呢,放飞自我放飞的根本一些。

论文是这篇:  RaSQL: Greater Power and Performance for Big Data Analytics with Recursive-aggregate-SQL on Spark, SIGMOD 19.

Continue reading →