Category “YeSQL” — 77 articles

Window Functions example remix

The drawback of hosting a static only website is, obviously, the lack of comments. What happens actually, though, is that I receive very few comments by direct mail. As I don’t get another spam source to cleanup, I’m left unconvinced that’s such a drawback. I still miss the low probability of seeing blog readers exchange directly, but I think a tapoueh.org mailing list would be my answer, here… Anyway, David Fetter took the time to send me a comment by mail with a cleaned up rewrite of the previous entry SQL, here’s it for your pleasure!



Window Functions example

So, when 8.4 came out there was all those comments about how getting window functions was an awesome addition. Now, it seems that a lot of people seeking for help in #postgresql just don’t know what kind of problem this feature helps solving. I’ve already been using them in some cases here in this blog, for getting some nice overview about Partitioning: relation size per “group”. *That's another way to count change* Now, another example use case rose on IRC today.


Happy Numbers

After discovering the excellent Gwene service, which allows you to subscribe to newsgroups to read RSS content ( blogs, planets, commits, etc), I came to read this nice article about Happy Numbers. That’s a little problem that fits well an interview style question, so I first solved it yesterday evening in Emacs Lisp as that’s the language I use the most those days. A happy number is defined by the following process.


Playing with bit strings

The idea of the day ain’t directly from me, I’m just helping with a very thin subpart of the problem. The problem, I can’t say much about, let’s just assume you want to reduce the storage of MD5 in your database, so you want to abuse bit strings. A solution to use them works fine, but the datatype is still missing some facilities, for example going from and to hexadecimal representation in text.


This time, we are trying to figure out where is the bulk of the data on disk. The trick is that we’re using DDL partitioning, but we want a “nice” view of size per partition set. Meaning that if you have for example a parent table foo with partitions foo_201006 and foo_201007, you would want to see a single category foo containing the accumulated size of all the partitions underneath foo.

Dimitri Fontaine

PostgreSQL Major Contributor

Open Source Software Engineer

France