Skip to content

Commit 3bf966c

Browse files
authored
Merge pull request #157 from mcarmonaa/improvement/index-created-at
added index idx_gitub_created_at on github table
2 parents 8dd6882 + 25ac6e3 commit 3bf966c

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

core/client.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,16 @@ func CreateGithubTable(DB *sql.DB) error {
8585
htmlurl varchar(1023),
8686
description text,
8787
fork boolean not null
88-
)`)
88+
);`)
89+
90+
if err != nil {
91+
return err
92+
}
93+
94+
_, err = DB.Exec(`CREATE INDEX IF NOT EXISTS idx_github_created_at
95+
ON github
96+
USING BTREE
97+
(created_at DESC NULLS LAST);`)
8998

9099
return err
91100
}

0 commit comments

Comments
 (0)