Skip to content

QuestDB partitions #316

Closed Answered by marregui
Maros112358 asked this question in Q&A
Sep 12, 2023 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

hi! https://questdb.io/docs/reference/function/meta/#table_partitions

example:

CREATE TABLE my_table AS (
    SELECT
        rnd_symbol('EURO', 'USD', 'OTHER') symbol,
        rnd_double() * 50.0 price,
        rnd_double() * 20.0 amount,
        to_timestamp('2023-01-01', 'yyyy-MM-dd') + x * 6 * 3600 * 100000L timestamp
    FROM long_sequence(700)
), INDEX(symbol capacity 32) TIMESTAMP(timestamp) PARTITION BY WEEK;

table_partitions('my_table');

you can also use it with filters:

table_partitions('sqlalchemy_raw') where name = 'default'

in fact the above is just a shortcut for:

SELECT * FROM table_partitions('sqlalchemy_raw') WHERE name = 'default'

you may like to join the slack channel

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@marregui
Comment options

Answer selected by burningalchemist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants