Last active
August 7, 2022 04:18
-
-
Save bharath-kotha/0a6d849736374671e4d20230e31991de to your computer and use it in GitHub Desktop.
How SELECT statement can cause disk write IO - create tables
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE author ( | |
id bigserial primary key, | |
name varchar(64) not null, country varchar(64) | |
); | |
CREATE TABLE book ( | |
id bigserial primary key, | |
title varchar(128) not null, | |
author_id bigint NOT NULL, | |
CONSTRAINT fk_books_author_id FOREIGN KEY (author_id) REFERENCES author(id) | |
); | |
CREATE INDEX idx_book_author_id ON book(author_id); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment