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
0
5.7k
Агрегация и обработка статистики
Доклад Валерия Змиевского, kharkivpy #8
Yehor Nazarkin
August 12, 2013
Tweet
Share
More Decks by Yehor Nazarkin
See All by Yehor Nazarkin
Flask, гордость и предубеждения
nimnull
0
320
Python non-mainstream web
nimnull
0
140
Write once, run everywhere
nimnull
0
6.2k
GPU Computing in Python
nimnull
1
5.7k
To Flask or not to Flask
nimnull
5
620
MongoDB Без ORM
nimnull
0
290
REST in Flask (And small client-side intro)
nimnull
10
1.7k
Other Decks in Programming
See All in Programming
Boost Your Performance and Developer Productivity with Jakarta EE 11
ivargrimstad
0
1.2k
Making TCPSocket.new "Happy"!
coe401_
1
130
AHC045_解説
shun_pi
0
480
Rollupのビルド時間高速化によるプレビュー表示速度改善とバンドラとASTを駆使したプロダクト開発の難しさ
plaidtech
PRO
1
160
技術選定を未来に繋いで活用していく
sakito
3
100
Enterprise Web App. Development (1): Build Tool Training Ver. 5
knakagawa
1
110
これだけは知っておきたいクラス設計の基礎知識 version 2
masuda220
PRO
24
6.1k
Coding Experience Cpp vs Csharp - meetup app osaka@9
harukasao
0
730
いまさら聞けない生成AI入門: 「生成AIを高速キャッチアップ」
soh9834
15
4.5k
サービスレベルを管理してアジャイルを加速しよう!! / slm-accelerate-agility
tomoyakitaura
1
170
Unlock the Potential of Swift Code Generation
rockname
0
240
Code smarter, not harder - How AI Coding Tools Boost Your Productivity | Webinar 2025
danielsogl
0
120
Featured
See All Featured
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
160
15k
Designing Experiences People Love
moore
141
24k
It's Worth the Effort
3n
184
28k
Faster Mobile Websites
deanohume
306
31k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
52
2.4k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
32
5.1k
Facilitating Awesome Meetings
lara
54
6.3k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.4k
For a Future-Friendly Web
brad_frost
176
9.7k
Raft: Consensus for Rubyists
vanstee
137
6.9k
RailsConf 2023
tenderlove
30
1.1k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
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’