Tag Archives: db

Window functions basics

For many developers, window functions are this mystical feature they only use once a year to build the famous Top-k query. In fact, they are part of the sql:2003 standard (yes, that’s 10 years from now) and your DBMS should already have a great and optimized support for windowing functions. If you should keep only […]

Read more

Auto partitioning in postgresql – Part 2

After having created the partitions, now we will create a maintenance function that will help us running queries on every partition.   We saw in the first part how to dynamically create the needed partitions. Just add this function in Postgresql (via psql for instance) :   This function is really useful. To call it, […]

Read more

Auto partitioning on Postgresql – Part 1

We will share a simple approach to migrate existing tables to partitioned versions of them with Postgresql. The partitions will be created on demand with just a few lines of codes. It is useful during off-line migration, and can be used in production with applications that don’t do so much INSERT. Approach Let’s say you […]

Read more