Code Monkey home page Code Monkey logo

citus-test's Introduction

citus cluster

setup

k3d cluster create -c k3d.yaml

kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.5.4/cert-manager.yaml

kubectl create secret generic citus-secrets --from-literal "password=$(openssl rand -base64 23)"
kubectl apply -f k8s

kubectl exec -it sts/citus-coordinator -- psql -U postgres < sql/schema.sql
kubectl exec -it sts/citus-coordinator -- psql -U postgres < sql/fixtures.sql

row count of all tables

select table_schema,
       table_name,
       (xpath('/row/cnt/text()', xml_count))[1]::text::int as row_count
from (
  select table_name, table_schema,
         query_to_xml(format('select count(*) as cnt from %I.%I', table_schema, table_name), false, true, '') as xml_count
  from information_schema.tables
  where table_schema = 'pim'
) t;

5min statement timeout

alter database postgres set statement_timeout to 300000;

select run_command_on_workers($cmd$
    alter database postgres set statement_timeout to 300000;
$cmd$);

cancel all queries on workers

select run_command_on_workers($cmd$
    select pg_cancel_backend(pid) from pg_stat_activity where state = 'active' and pid <> pg_backend_pid();
$cmd$);

FTS values

set search_path = pim, ext;

create index fts on product using gin (to_tsvector('english', values->'text_attribute'->>'content'));

select * from product where to_tsvector(values->>'Pilot') @@ websearch_to_tsquery('jesse pinkman');
select * from product where to_tsvector(values->'text_attribute'->>'attribute#1') @@ websearch_to_tsquery('Unfortunately');

citus-test's People

Contributors

docteurklein avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

citus-test's Issues

Project status

Hi, I read the docs and all and it seems a really good work!
It is of course more a POC than a production thing, tho, so I was wondering what are your intentions on this, and if there is any chance this might evolve into something production ready, or if this will just stay as a reference for others trying to achieve the same.
Thank you very much!

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.