Skip to content

Instantly share code, notes, and snippets.

handuy

Block or report user

Report or block handuy

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View sub.vtt
WEBVTT
1
00:00:00.000 --> 00:00:02.325
[MUSIC PLAYING]
2
00:00:05.427 --> 00:00:06.260
KAYCE BASQUES: Hola!
@handuy
handuy / 5.sql
Created Sep 16, 2018
Cú pháp chạy: psql -U postgres -f [tên_file]. Chạy ở citus_master
View 5.sql
DROP TABLE IF EXISTS users CASCADE;
DROP TABLE IF EXISTS posts CASCADE;
DROP SCHEMA IF EXISTS course CASCADE;
CREATE TABLE users (id int PRIMARY KEY, name text, age int);
CREATE TABLE posts (id int PRIMARY KEY, title text, author_id int REFERENCES users(id));
@handuy
handuy / 4.sql
Created Sep 16, 2018
Cú pháp chạy: psql -U postgres -f 4.sql. Chạy ở citus_master
View 4.sql
DROP TABLE IF EXISTS users;
DROP TABLE IF EXISTS posts;
DROP SCHEMA IF EXISTS course CASCADE;
CREATE TABLE users (id int PRIMARY KEY, name text, age int);
CREATE TABLE posts (id int PRIMARY KEY, title text, author_id int REFERENCES users(id));
@handuy
handuy / 3.sql
Last active Sep 16, 2018
Cú pháp chạy: psql -U postgres -f [tên_file]. Chạy file 3.sql ở citus_woker_1, 3_test.sql ở citus_master
View 3.sql
DROP TABLE IF EXISTS series;
CREATE TABLE series (id int, description text);
SELECT create_reference_table('series');
@handuy
handuy / 2.sql
Last active Sep 16, 2018
Cú pháp chạy: psql -U postgres -f [tên_file]. Chạy file 2.sql ở citus_master, 2_test.sql ở citus_worker_1
View 2.sql
DROP TABLE IF EXISTS users;
DROP TABLE IF EXISTS posts;
DROP SCHEMA IF EXISTS course CASCADE;
CREATE SCHEMA course;
CREATE TABLE users (id int, name text, age int);
@handuy
handuy / 1.sql
Last active Sep 16, 2018
Cú pháp: psql -U postgres -f [tên_file]. Chạy file 1.sql ở citus_master, 1_test.sql ở citus_worker_1
View 1.sql
DROP TABLE IF EXISTS users;
DROP TABLE IF EXISTS posts;
CREATE TABLE users (id int, name text, age int);
CREATE TABLE posts (id int, title text);
SELECT create_reference_table('users');
@handuy
handuy / vietnamese_convert.sql
Created Jul 10, 2018
Convert Vietnamese character
View vietnamese_convert.sql
á a
à a
ã a
ạ a
ả a
A a
Á a
À a
à a
Ạ a
View check_unaccent.sql
SELECT unaccent('Tiếng Việt có dấu')
@handuy
handuy / unaccent.sql
Created Jul 10, 2018
Cài đặt extension unaccent
View unaccent.sql
CREATE EXTENSION unaccent
@handuy
handuy / select_5000_noti.sql
Last active Jun 8, 2018
Select 5000 bản ghi từ bảng noti --> mất 2 secs 15 msec
View select_5000_noti.sql
select * from noti where sender = 1015;
select * from noti where sender = 1640;
select * from noti where sender = 1641;
select * from noti where sender = 1016;
select * from noti where sender = 1001;
select * from noti where sender = 1002;
select * from noti where sender = 1003;
select * from noti where sender = 1004;
select * from noti where sender = 1005;
select * from noti where sender = 1006;
You can’t perform that action at this time.