Code Monkey home page Code Monkey logo

postgresql-time-series-table-partitions's Introduction

postgresql-time-series-table-partitions

Originally for monthly table partitions, more info at imperialwicket.com.

This currently duplicates a similar gist, but revision maintenance and change requests were becoming burdensome.

Eventually I'll copy over data from the blog post to this readme (PR requests welcome for this and any other changes!).

Note that update_partitions.sql and update_partitions_no_unknown_table.sql are mutually exclusive. update_partitions.sql creates an 'unknown' table, and any dated inserts that don't have an appropriate child table automatically go here. If you have dirty data, or want to pay close attention to inserts for reporting, this could work well for you. update_partitions_no_unknown_table.sql has an alternate trigger that will dynamically create a missing child table for the appropriate date interval when an 'unknown' insert occurs. If you have unpredictable data that should always be well-organized, this alternative could be more productive than managing the unknown table (thanks @sandinosaso for this!). The trigger in update_partitions_no_unknown_table.sql relies on syntax available in Postgres 9.1 and newer.

postgresql-time-series-table-partitions's People

Contributors

elisnow avatar imperialwicket avatar jfranki avatar jmerino-iib avatar samyellowsnow avatar sandinosaso avatar wamdam avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.