Skip to content

Instantly share code, notes, and snippets.

View kmuthukk's full-sized avatar

Kannan Muthukkaruppan kmuthukk

View GitHub Profile
@kmuthukk
kmuthukk / fires_load.sql
Last active June 13, 2022 23:25
Sample load script for "fires" synthetic test data.
# Dependencies:
# On CentOS you can install psycopg2 thus:
#
# sudo yum install postgresql-libs
# sudo yum install python-psycopg2
import psycopg2;
import datetime;
from multiprocessing.dummy import Pool as ThreadPool
# Dependencies:
# On CentOS you can install psycopg2 thus:
#
# sudo yum install postgresql-libs
# sudo yum install python-psycopg2
import psycopg2;
from multiprocessing.dummy import Pool as ThreadPool
num_tenants=100
@kmuthukk
kmuthukk / ysql_many_tables.py
Created May 29, 2021 15:07
sample script to load test creations of tables across many schemas
# Dependencies:
# On CentOS you can install psycopg2 thus:
#
# sudo yum install postgresql-libs
# sudo yum install python-psycopg2
import psycopg2;
from multiprocessing.dummy import Pool as ThreadPool
connect_string = "host={} dbname=yugabyte user=yugabyte port=5433".format("172.151.44.47");
# Dependencies:
# On CentOS you can install psycopg2 thus:
#
# sudo yum install postgresql-libs
# sudo yum install python-psycopg2
import psycopg2;
from multiprocessing.dummy import Pool as ThreadPool
num_users=1000000
package com.yugabyte.sample.apps;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.PreparedStatement;
import java.sql.Array;
import java.util.ArrayList;
package com.yugabyte.sample.apps;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.PreparedStatement;
import java.sql.Array;
import java.util.ArrayList;
package com.yugabyte.sample.apps;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.PreparedStatement;
public class DeferrableScan {
# Dependencies:
# On CentOS you can install psycopg2 thus:
#
# sudo yum install postgresql-libs
# sudo yum install python-psycopg2
import psycopg2
from threading import Thread,Semaphore
import random
import time
# Dependencies:
# On CentOS you can install psycopg2 thus:
#
# sudo yum install postgresql-libs
# sudo yum install python-psycopg2
import psycopg2
import time
from multiprocessing.dummy import Pool as ThreadPool
@kmuthukk
kmuthukk / ycql_overwrite_range_query.py
Created October 10, 2020 01:55
test program to test range scan in the presence of high overwrites
pip install yb-cassandra-driver
from cassandra.cluster import Cluster
from cassandra import ConsistencyLevel
import time
import random
from multiprocessing.dummy import Pool as ThreadPool
cluster = Cluster(['127.0.0.1'])