Skip to content

Instantly share code, notes, and snippets.

View macobo's full-sized avatar
🚀

Karl-Aksel Puulmann macobo

🚀
View GitHub Profile
SELECT groupArray(value)
FROM (
SELECT trim(BOTH '"' FROM JSONExtractRaw(person_props, 'name')) AS value,
count(*) as count
FROM events e
INNER JOIN (
SELECT distinct_id,
argMax(person_id, version) as person_id
FROM person_distinct_id2
WHERE team_id = 1
"Limit (cost=6900944.76..6900945.40 rows=51 width=310) (actual time=236445.533..236445.567 rows=51 loops=1)"
" -> Sort (cost=6900944.76..6900945.26 rows=200 width=310) (actual time=236445.531..236445.558 rows=51 loops=1)"
" Sort Key: (min(count.""timestamp"")) DESC"
" Sort Method: top-N heapsort Memory: 4020kB"
" -> Nested Loop Left Join (cost=6857145.13..6900937.12 rows=200 width=310) (actual time=191441.082..235780.106 rows=60797 loops=1)"
" -> Nested Loop Left Join (cost=6857144.71..6900813.73 rows=200 width=108) (actual time=191441.062..234426.907 rows=60797 loops=1)"
" -> GroupAggregate (cost=6857144.28..6899155.23 rows=200 width=104) (actual time=191440.976..232361.857 rows=60797 loops=1)"
" Group Key: count.global_session_id"
" -> Sort (cost=6857144.28..6861345.03 rows=1680298 width=1372) (actual time=191439.421..193475.095 rows=1674396 loops=1)"
" Sort Key:
# Large data (580kb): (edited)
⟩ k6 run --vus 10 --duration 30s benchmark-ph.js 14:40:18
/\ |‾‾| /‾‾/ /‾‾/
/\ / \ | |/ / / /
/ \/ \ | ( / ‾‾\
/ \ | |\ \ | (‾) |
/ __________ \ |__| \__\ \_____/ .io
@macobo
macobo / raw-
Created December 3, 2020 22:11
Did some measurements on deflate:
For session recording:
- Current batches:
In general: deflate for /s was hovering between 18-25% data size, lz64 ~45-55%
Packing individual events hovered at around 23-27% of data size.
/s
deflate: 0.19086889535248105
lz64: 0.4443071067359241
SELECT "posthog_event"."id",
"posthog_event"."team_id",
"posthog_event"."event",
"posthog_event"."distinct_id",
"posthog_event"."properties",
"posthog_event"."timestamp",
"posthog_event"."elements_hash",
"posthog_event"."elements",
(
SELECT X0."id"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
services:
demo:
wms:
wmts:
tms:
use_grid_names: true
origin: 'nw'
sources:
maaamet_ortofoto:
class ApplicationRecord < ActiveRecord::Base
self.abstract_class = true
# This method adds a hidden activerecord relationship.
#
# The relationship is hidden as you cannot access them via `model.assocation`, but can be
# preloaded and can be accessed within specific components by wrapping the model.
#
# Use this for associations on models which have been moved under specific components and
# expose these associations instead in the model itself.
module MyExtendedMixin
def setter(x)
@var = x
end
def getter
@var || super
end
end
require 'rubyXL'
workbook = RubyXL::Parser.parse('testsheet.xlsx')
sheet = workbook.worksheets[0]
class TemplateSheet
attr_reader :sheet, :row_count
RowRepeater = Struct.new(:row, :array_name, :item_variable_name, :index_variable_name)