Taken from here
We deploy without downtime when we can to avoid user frustration. It's pretty rare that we can't.
There's a great talk/slideshow on this, but no convenient reference that we're aware of – hence this document.
require 'fiber' | |
require 'ox' | |
module Ox | |
class PushParser | |
def initialize(handler, options = {}) | |
@buf = '' | |
@fiber = Fiber.new do | |
Ox.sax_parse(handler, self, options) | |
end |
require 'enumerator' | |
require 'ox' | |
module Ox | |
class PushParser | |
DEFAULT_BUFSIZE = 4096 | |
def initialize(handler, options = {}, &blk) | |
@buf = '' | |
@generator = Enumerator.new(&blk) |
./extract.sh | wc -l |
WITH table_scans as ( | |
SELECT relid, | |
tables.idx_scan + tables.seq_scan as all_scans, | |
( tables.n_tup_ins + tables.n_tup_upd + tables.n_tup_del ) as writes, | |
pg_relation_size(relid) as table_size | |
FROM pg_stat_user_tables as tables | |
), | |
all_writes as ( | |
SELECT sum(writes) as total_writes | |
FROM table_scans |
def f(q,n) | |
if(n==nil) | |
return null; | |
end | |
l=0; h=ln(q)-1;d=l<=h; | |
while d | |
x=(l+h)/2;v=q[x] | |
if v>n then h=x-1 | |
elsif v<n then l=x+1 | |
else return v |
class FibonacciCalculator | |
def initialize | |
end | |
def run | |
number = ARGV.first | |
puts "Fibonacci number for N=#{number}: #{fib(number.to_i)}" | |
end |
defmodule Friends.Application do | |
# See https://hexdocs.pm/elixir/Application.html | |
# for more information on OTP Applications | |
@moduledoc false | |
use Application | |
def start(_type, _args) do | |
# List all child processes to be supervised | |
children = [ |
Full list of changes: https://why-upgrade.depesz.com/show?from=9.5.21&to=11.7
Copyright 2020 Glia Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER D