Dancing Links

Recently I happen to see someone posts that the most beautiful data structure in his mind is Dancing Links. The name bursts my interest to understand one more idea from Dr. Knuth. (again let me paste the margin comment of Concrete Mathematics here):

Actually Gauss is often called the greatest mathematician of all time. So it’s nice to be able to understand at least one of his discoveries.

Follow the curiosity and keep youth. I am writing this blog to re-state the algorithm to confirm my understanding.

Continue reading

2021VMware中国区编程比赛小记

我2017年7月加入Pivotal,伴随着被收购,2020年4月成为了VMware的员工。Greenplum近期招聘了非常多优秀的年轻人,充满希望。在看到了今年中国区编程比赛的报名通知的时候,我立刻把信息转发给某个manager,建议组织一些年轻人去打,最好拿个奖回来,多少扬扬名。然后Greenplum团队组了两个绝对年轻的队伍,全部是入职一年以内(或者出头一点点)。比赛昨天结束,两个队伍一个第一,一个第二,成绩很优异。

我没有参加,但是下午的时候,我看了一眼题目,第一反应肯定是NP问题,第二反应,这种东西,就应该用声明式编程语言求搞定。然后我花了一点点时间,写了一个Python程序,把题目编译成SMT程序,然后丢给Z3求解器去搞定。没有做什么优化,可以跑出8组解,感觉如果继续加入一些人类经验去优化,应该可以搞定大部分(有点装得不负责任)。

Continue reading

Squelch Logic in Greenplum

Recently I have reviewed a PR from my colleague: Fix crash on QD when squelching CTE producer with a Motion child. This PR from Alexandra Wang (a very smart engineer from Greenplum Team) is well documented in the PR message and has detailed comments, also contains carefully designed test cases. Readers can feel the style of how Greenplum’s open-source community works. Next, let’s come back to the technical details of Greenplum’s Squelch logic (All best ideas are from Alex).

Continue reading

How to hack Greenplum & Postgres?

背景

这篇主要写个中文社区里希望上手开发的工程师或者大学生朋友们,期待他们可以快速上手Postgres或者Greenplum的开发和调试。我本人2017年7月入职Pivotal从事Greenplum开发,实话实话,上手过程非常痛苦,可能跟一开始接触的项目有关,大概得有将近一年才初窥门径。回顾起来,怎么看都太慢了。

尔后,疫情期间,我指导曾经助教的学生Hack Postgres | Greenplum,用结对编程的模式,zoom录屏的方式,他极快的上手了开发。并且短时间内就给Greenplum提交了两个Patch,给Postgres提交了一个Patch(PostgreSQL v13 release的致谢名单里就有他的名字)。再后来,我又把资料给一个大龄程序员,他诊断和阅读代码的能力不错,故而也很快上手,给Greenplum提交了若干Patch并且发现了一个比较重要的方向。这些Patch都并不是Naive的Patch,都是很有用并且涉及知识点比较广的问题。还有就是今年带的一个实习生,也是大概2-3周就给Greenplum提交了一个Patch,使得Greenplum 7的OLTP性能飙升(当然不是完全属于他的独立的工作)。

上述经历和尝试,证明了,只要有扎实C语言功底,就可以快速上手。其他的遇到了再学,各个深入即可。

Continue reading

2021年 六月·漏船载酒 逆流而上

题记

你有逆流而上的勇气,也有漏船载酒的运气。做人做到如此晦气。何不赚个爽快?

——《我的团长我的团》兰晓龙

计划

没想到写一篇Paper后续这么多事,录制视频,做slide,还要准备线下活动,这俩月真是匆匆忙忙,私下并没有学习,这点让人很吃惊。

接下来是一个新的开始,期待能够研读一下SIGMOD的paper,然后进一步研究两种基础技能:计算机的体系结构以及编译器技术。