Skip to content

Instantly share code, notes, and snippets.

View kevinisbest's full-sized avatar
:octocat:
Focusing

Kevin Hsiao kevinisbest

:octocat:
Focusing
View GitHub Profile
@kevinisbest
kevinisbest / Master-worker.go
Created September 17, 2019 06:40
Processing all files with same extension in master-worker concurrency way
package main
import (
"fmt"
"os"
"path/filepath"
"strings"
"sync"
)
@ian-whitestone
ian-whitestone / notes.md
Last active March 1, 2023 01:45
Best practices for presto sql

Presto Specific

  • Don’t SELECT *, Specify explicit column names (columnar store)
  • Avoid large JOINs (filter each table first)
    • In PRESTO tables are joined in the order they are listed!!
    • Join small tables earlier in the plan and leave larger fact tables to the end
    • Avoid cross joins or 1 to many joins as these can degrade performance
  • Order by and group by take time
    • only use order by in subqueries if it is really necessary
  • When using GROUP BY, order the columns by the highest cardinality (that is, most number of unique values) to the lowest.