Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Агрегация и обработка статистики
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Yehor Nazarkin
August 12, 2013
Programming
5.7k
0
Share
Агрегация и обработка статистики
Доклад Валерия Змиевского, kharkivpy #8
Yehor Nazarkin
August 12, 2013
More Decks by Yehor Nazarkin
See All by Yehor Nazarkin
Flask, гордость и предубеждения
nimnull
0
340
Python non-mainstream web
nimnull
0
170
Write once, run everywhere
nimnull
0
6.3k
GPU Computing in Python
nimnull
1
5.7k
To Flask or not to Flask
nimnull
5
640
MongoDB Без ORM
nimnull
0
320
REST in Flask (And small client-side intro)
nimnull
10
1.7k
Other Decks in Programming
See All in Programming
net-httpのHTTP/2対応について
naruse
0
430
TSKaigi Night Talks 2026_TypeScriptでサプライチェーンの整合性を型に閉じ込める
geekplus_tech
0
260
dRuby over BLE
makicamel
2
300
OSもどきOS
arkw
0
400
GitHub Copilot CLIのいいところ
htkym
2
1.3k
メソッドのジェネリクスでGoの夢は広がるか? / Kyoto.go #65
utgwkk
3
460
生成AI時代にこそ効くGo | Why Go Works in the Age of Generative AI
mom0tomo
8
3.1k
開発体験を左右するライブラリの API 設計 - GraphQL スキーマ構築ライブラリから考える #tskaigi
izumin5210
2
1.6k
セキュリティの専門家じゃなくてもできる。「セキュリティ意識」をアップデートして サプライチェーン攻撃への耐性を高めよう。
tk3fftk
5
610
tsserverとは何だったのか、これからどうなるのか
nowaki28
1
440
さぁV100、メモリをお食べ・・・
nilpe
0
130
3Dシーンの圧縮
fadis
1
600
Featured
See All Featured
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
1.1k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
190
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
380
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.5k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.3k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
260
Thoughts on Productivity
jonyablonski
76
5.2k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.5k
Writing Fast Ruby
sferik
630
63k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.2k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
300
Transcript
Агрегация и обработка статистики реального времени Валерий Змиевской
Что нам нужно? • База данных • Отказаться от запросов:
group by keyfield … order by sum(datafield) desc • Upsert MongoDB, MySQL - есть нативный синтаксис
Как хранить данные Хранить данные для каждого ключа группировки в
отдельной таблице: user : [last_login, orders, coupons_used, …] category, date : [orders_amount, items_sold] region, date : [orders_amount, items_sold] ….
OLAP-куб на одной таблице Ключи : данные [region, category, year,
month] : [ord, isold] [<all>, 12, 2013, 01] : [100, 665] [<all>, <all>, 2013, 01] : [1600, 5200] ….
Срезы [region, category, year, month] [0, 0, 1, 0], [0,
0, 1, 1], [1, 0, 1, 0], [1, 0, 1, 1] [0, 1, 1, 0], [0, 1, 1, 1], [1, 1, 1, 0], [1, 1, 1, 1] [0, 1, 0, 0], [1, 1, 0, 0] Не нужны срезы: [*, *, 0, 1] и [*, 0, 0, 0]
Показываем: category, графики по месяцам Сортируем: ord, isold Индексы: •
region, category, year, month - unique|Charts • region, year, month, ord - Orders/Category • region, year, month, isold - It. sold/Category Индексы
Запросы: Категории: region=<all>, year=<all>, month=<all> region=EU, year=<all>, month=<all> region=EU, year=2013,
month=<all> График по категории Goods за 2013 год region=EU, year=2013, category=’Goods’