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
Lemonade + Foundry Toolkit でお手軽アプリ開発
seosoft
1
240
Skillは並べた。動かなかった。契約で繋いだ。— 65個のSkillから、自走する開発サイクルへ
junholee
0
790
JavaDoc 再入門
nagise
0
220
ECR拡張スキャンでSBOMを収集して サプライチェーン攻撃の影響調査を 爆速で終わらせてみた
akihisaikeda
2
210
AIチームを指揮するOSS「TAKT」活用術 / How to Use “TAKT,” an OSS Tool for Orchestrating AI Teams
nrslib
6
750
Hive Metastoreを通して学ぶIceberg REST Catalog ― 仕様から実装まで
okumin
0
310
柔軟なPDFレイアウトエディタを支える型システム設計 — Discriminated UnionとConditional Typeの実践
minako__ph
4
1.2k
Signal Forms: Beyond the Basics @ngBaguette 2026 in Paris
manfredsteyer
PRO
0
180
GitHub Copilot CLIのいいところ
htkym
2
1.2k
ビジネスモデルから紐解く、AI+型駆動開発
hirokiomote
2
4.4k
Copilot CLI の継戦能力を高める コンテキスト管理
nozomutu
1
1.1k
CSC307 Lecture 17
javiergs
PRO
0
280
Featured
See All Featured
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
210
Test your architecture with Archunit
thirion
1
2.3k
The Curse of the Amulet
leimatthew05
1
13k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
200
Code Reviewing Like a Champion
maltzj
528
40k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
540
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
55k
A better future with KSS
kneath
240
18k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
118
120k
[SF Ruby Conf 2025] Rails X
palkan
2
1.1k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
930
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’