👻幽灵捕手——Dancing Links

缘由

之前一阵子,慕慕妈妈给慕慕买了一个益智小玩具——👻幽灵捕手。

刚刚通了一关的吕小慕

这个游戏的介绍视频可以参考: 幽灵捕手玩法视频。整整一年前我恰好看了Knuth的Dancling Links(参考之前的blog: https://kainwen.com/2022/01/03/dancing-links/ ) ,最近看着吕小慕玩儿这个游戏,顿时觉得,这就是一个可以用Dancling Links解决的Exact Cover Problem。那就让我们来试试看吧。

Continue reading

🐶🐰谜题

背景:Greenplum Team的Big Standup

Greenplum Team有一个源自从Pivotal时代的晨会仪式,称为Big Standup。2020年4月,被收购成为VMware Greenplum后,由于VMware的未来办公模式,永久的远程办公(甚至可以改Base),中国团队每天的Standup改为线上的zoom,为了更加活泼有趣,主持人需要想一个游戏,或者做一个小分享。这个活动成为了每天最吸引人的事情了。

谜题介绍:Dog Bunny Puzzle

有一个同事,找了一个有趣的类似华容道的益智游戏,对应的网站是 https://www.dogbunnypuzzle.com/。2022年12月24日的那个关卡如下图:

2022年12月24日的犬兔谜题
Continue reading

Analysis of Algorithm S

Last week I have a discussion with a colleague who is working on improving the analyze-speed of AO|AOCS table in Greenplum (at least 10x speed up). We search the Internet and do not find the performance analysis of Algorithm S and Knuth’s TAOCP left this (mean and var) as exercises. This blog is the solution to Knuth’s exercises.

Continue reading

不踬于山——追踪内存泄漏

不踬于山,而踬于垤。—— 先秦圣谚

最近在Greenplum 6X上发现了一个内存泄漏,Memory Leak DynamicBitmap Index Scan in Nestloop’s inner plan #14122, 查询和查询计划与和之前修复过的如出一辙,所以肯定是来了新的泄漏。这一次可以复现问题,能复现的bug,修复只是时间问题,我的同事此刻已经搞定了,开出了Pull Request (见Issue页面)。本文是我做事后诸葛亮,看看能否用一些工具快速定位这个问题。

Continue reading

On pg_relation_size in Greenplum

Recently I have been working on several issues involving relation_size in Greenplum, this post is to summarize some interesting parts of the topic. I also post a thread on gpdb-dev mailing list: https://groups.google.com/a/greenplum.org/g/gpdb-dev/c/DkTx4O-kuH0.

The problem

Q: there is a table storing some other tables’ oid, how to write a  SQL to compute table size for each oid?
This problem is so simple in Postgres (single instance), but it turns much more complex than the first glance to work this out high efficiently in Greenplum.

Continue reading