Skip to content

Instantly share code, notes, and snippets.

View romikoops's full-sized avatar

Roman Parashchenko romikoops

View GitHub Profile
SELECT
t0. "id",
t0. "inserted_at"::timestamp AT TIME ZONE 'Etc/UTC' AT TIME ZONE 'Europe/Amsterdam',
o1. "inserted_at"::timestamp AT TIME ZONE 'Etc/UTC' AT TIME ZONE 'Europe/Amsterdam',
o1. "id",
o3. "id" AS "client_order_id",
o4. "id" AS "hedge_order_id",
o1. "source",
c2. "slug",
t0. "position",
@romikoops
romikoops / query_planner.markdown
Created June 3, 2021 17:34 — forked from hgmnz/query_planner.markdown
PostgreSQL query plan and SQL performance notes

Types of index scans

Indexes

Sequential Scan:

  • Read every row in the table
  • No reading of index. Reading from indexes is also expensive.
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: system:aggregated-metrics-reader
labels:
rbac.authorization.k8s.io/aggregate-to-view: "true"
rbac.authorization.k8s.io/aggregate-to-edit: "true"
rbac.authorization.k8s.io/aggregate-to-admin: "true"
rules:
@romikoops
romikoops / helm-cheatsheet.md
Created September 5, 2019 23:19 — forked from tuannvm/cka.md
#Helm #Kubernetes #cheatsheet, happy helming!
This file has been truncated, but you can view the full file.
This file has been truncated, but you can view the full file.
@romikoops
romikoops / release_tasks.ex
Created July 30, 2018 08:29 — forked from AndrewDryga/release_tasks.ex
Elixir Release Tasks
defmodule MyAppAPI.ReleaseTasks do
alias Ecto.Migrator
@otp_app :myapp_api
@start_apps [:logger, :ssl, :postgrex, :ecto]
def migrate do
init(@otp_app, @start_apps)
run_migrations_for(@otp_app)
@romikoops
romikoops / PostgreSQL_index_naming.rst
Created July 5, 2018 19:24 — forked from popravich/PostgreSQL_index_naming.rst
PostgreSQL index naming convention to remember

The standard names for indexes in PostgreSQL are:

{tablename}_{columnname(s)}_{suffix}

where the suffix is one of the following:

  • pkey for a Primary Key constraint;
  • key for a Unique constraint;
  • excl for an Exclusion constraint;
  • idx for any other kind of index;
@romikoops
romikoops / article-test.exs
Created May 28, 2018 09:59 — forked from lee-dohm/article-test.exs
Sample files for blog post "Simpler Elixir Travis Configuration" ... http://www.lee-dohm.com/2017/12/24/simpler-elixir-travis-configuration/
use Mix.Config
# We don't run a server during test. If one is required,
# you can enable the server option below.
config :hello_phoenix, HelloPhoenix.Endpoint,
http: [port: 4001],
server: false
# Print only warnings and errors during test
config :logger, level: :warn