Skip to content

Instantly share code, notes, and snippets.

View FranckPachot's full-sized avatar

Franck Pachot (YB) FranckPachot

View GitHub Profile
@FranckPachot
FranckPachot / joins_scale_on_yuagybte.sql
Last active April 24, 2023 11:32
For the next time you hear that "Joins Don't Scale": Joining to a 7M rows table to return 20K rows with text search filters in 50 milliseconds on @yugabyte​DB and that scales as the plan doesn't depend on the table size😎 SQL databases rocks 🚀
-- load names
\! wget -cO/var/tmp/baby-names.csv "https://github.com/hadley/data-baby-names/blob/master/baby-names.csv?raw=true"
drop table if exists baby_names;
create table baby_names ( year int , name text, percent float, sex text, primary key (name,year, sex));
\copy baby_names from '/var/tmp/baby-names.csv' with ( skip 1, format csv );
-- joins scale
drop table if exists users,messages cascade;
create table users (
primary key (user_id)
@jrudolph
jrudolph / yugabyte-debugging.md
Last active September 12, 2022 09:27
Yugabyte debugging

Yugabyte Debugging Case Study

Problem

Under load, the yugabyte clusters showed a latency spike ~ every 30 seconds. Latencies went up to 4 seconds.

Analysis

Aside from the main problem, we found that one of the servers in the cluster showed CPU saturation during those spikes. Since the spikes were frequent enough, top could be used to identify the yb-master process as the

@eatonphil
eatonphil / psql-srv.py
Last active April 28, 2024 09:26 — forked from matteobertozzi/psql-srv.py
postgres "server" wire protocol example (ported python3)
# th30z@u1310:[Desktop]$ psql -h localhost -p 55432
# Password:
# psql (9.1.10, server 0.0.0)
# WARNING: psql version 9.1, server version 0.0.
# Some psql features might not work.
# Type "help" for help.
#
# th30z=> select foo;
# a | b
# ---+---