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
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
検索設計から 推論設計への重心移動と Recall-First Retrieval
po3rin
5
1.7k
書き換えて学ぶTemporal #fukts
pirosikick
2
380
ソフトウェア設計の結合バランス #phperkaigi
kajitack
0
510
ハーネスエンジニアリングとは?
kinopeee
13
7.1k
Terraform言語の静的解析 / static analysis of Terraform language
wata727
1
150
[BalkanRuby 2026] Drop your app/services!
palkan
2
340
〜バイブコーディングを超えて〜 チームで実験し続けたAI駆動開発
tigertora7571
0
210
クラウドネイティブなエンジニアに向ける Raycastの魅力と実際の活用事例
nealle
2
260
AIを導入する前にやるべきこと
negima
2
360
Agent Skills を社内で育てる仕組み作り
jackchuka
1
2k
Kubernetesを使わない環境にもCloud Nativeなデプロイを実現する / Enabling Cloud Native deployments without the complexity of Kubernetes
linyows
3
410
20年以上続くプロダクトでも使い続けられる静的解析ツールを求めて
matsuo_atsushi
0
150
Featured
See All Featured
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.4k
Building Adaptive Systems
keathley
44
3k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
1
310
Test your architecture with Archunit
thirion
1
2.2k
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.1k
GitHub's CSS Performance
jonrohan
1033
470k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
30 Presentation Tips
portentint
PRO
1
290
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
180
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Tell your own story through comics
letsgokoyo
1
920
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’