Git Product home page Git Product logo

promscale_extension's Introduction

Warning

Promscale has been discontinued and is deprecated.

The code in this repository is no longer maintained.

Learn more.

Promscale Extension

From Promscale version 0.11.0, this Postgres extension is an integral part of Promscale. It is required to be installed. Check the release notes for more details.

The extension plays two important roles:

  1. It manages the SQL data schema and migrations that manipulate it.
  2. It encompasses code that runs within a database instance, both PL/pgSQL and native.

Motivation

It's fairly common for backend applications to manage their database schema via a migration system. Altering a table and adding an index are typical operations that come to mind. As Promscale grew in scope and complexity we found ourselves defining custom data types, aggregates and background jobs. Having the extension manage both the migration logic and various extensions helps to deal with situations when one depends on the other.

Yet, developer convenience is not the main reason this extension exists. It enables complex optimizations for both PromQL and SQL users. Let's have a look at two examples.

Custom aggregates like prom_rate, prom_delta and a few others are implemented in Rust and enable Promscale to push corresponding PromQL down to native code that is executed within PostgreSQL. The alternatives are either transferring all the data to the Promscale application and doing aggregation there, or a PL/pgSQL stored procedure. Both are substantially slower.

Support functions that transparently rewrite some queries to reduce the amount of computation required or take advantage of indices and tables specific to Promscale. For instance, the following query:

SELECT trace_id
    FROM ps_trace.span
    WHERE
            span_tags -> 'pwlen' = '25'::jsonb
        AND resource_tags -> 'service.name' = '"generator"';

will have an additional InitPlan stage that precomputes a set of matching tags, then uses a GIN index on a private _ps_trace.span table. While the naive version can only evaluate matching tags per row.

Requirements

To run the extension:

  • PostgreSQL version 12 or newer.

To compile the extension (see instructions below):

  • Rust compiler
  • PGX framework

Installation

Development

To quickly setup a development environment, see DEVELOPMENT.md To understand more about how to write SQL migration files for this extension, consult this guide. To get a better understanding of our CI pipeline see this document.

Releasing

A full checklist of the steps necessary to release a new version of the extension is available in RELEASING.md.

promscale_extension's People

Contributors

alejandrodnm avatar antekresic avatar arajkumar avatar bitwalker avatar cevian avatar firefishy avatar grawlinson avatar hacker avatar harkishen-singh avatar jamesguthrie avatar jgpruitt avatar jlockerman avatar mfreed avatar niksajakovljevic avatar oliora avatar pgnickb avatar ramonguiu avatar sumerman avatar vineethreddy02 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.