狠狠撸

狠狠撸Share a Scribd company logo
2011 3   4




2011   3   5
?                  DB




       ? Index
         Index                 Covering Index   Primary Key
           Read   Write


       ? MySQL
                                DB                            SQL




2011   3   5
?


           →(10001,A)
           ※


       ?
                          Primary Key
           →Primary Key


       ?
                            Primary Key



2011   3   5
?




                            ID
                   ID
                        1
               1
                        2
               2
                        2




2011   3   5
?
                                             ID           ID

                                      1           10001

                                      1           10002

                                      2           10001
                   ID           ID

               1        10001         2           10002

               1        10002

               2        10001

               2        10002                ID

                                     10001

                                     10002




2011   3   5
?

                                        ID     ID
                               1             101
                               2             102
                   ID     ID   3             103

               1        101    4             102

               2        102

               3        103

               4        102        ID
                               101
                               102
                               103




2011   3   5
ALTER TABLE

       ?


       ?                            (ALTER TABLE)
           →ALTER TABLE


       ?




       ?


           →



2011   3   5
ID                         ID
                   1               1         101               1
                   1               2         234               2
                   1               3         553               3
                   1               4         232               4
                   2               1         102
                   2               2         271
                   2               3         952


                   ID
               1             101       234    553       232   873   0     102   0
               2             102       271    8652      98    0     234   202   0
               3             103       952     76       765   872   45     0    0
               4             102       197    2312      762   4     232   672   34



       ?



2011   3   5
Index

       ? WHERE                             Index     Primary Key

       WHERE user_id = 10001

       → user_id    Index(        Primary Key)

       WHERE user_id = 10001 AND friend_id = 10002

       → (user_id, friend_id)

       WHERE visiting_id = 10001 AND visited_id IN (1,2,3) AND action=2

       → (visiting_id,visited_id,action)

       WHERE status = 2 ORDER BY start_time

       → (status,start_time)


2011   3   5
Index

       ?                  Index

       WHERE start_time < 12345678 AND state = 2

       →(start_time,state)                                    (state,start_time)

       ? Index

       WHERE visited_id = 10002 AND visiting_id = 10001 AND action=2

       → (visiting_id,visited_id,action)


       ?                             Index

       WHERE visiting_id = 10001 AND action = 2 AND visited_id = 10002

       → (visiting_id,visited_id,action)     Index   visiting_id


2011   3   5
Covering Index

       ?

           MySQL                                         Covering Index   - ( ? )o   sasata299's blog
           http://blog.livedoor.jp/sasata299/archives/51336006.html



       ?
                 Covering Index
           →




2011   3   5
Primary Key                                                 id

       ?             Primary Key
           →                     Primary Key                    MySQL               id
           Primary Key
           MySQL :: MySQL 5.1                          :: 13.5.13 InnoDB
           http://dev.mysql.com/doc/refman/5.1/ja/innodb-table-and-index.html


       ?        id              WHERE id IN (a,b,c,d...)


       ?        id
                                              id
                                    Primary Key                                 (        Covering
           Index          )



2011   3   5
Primary Key

       ?                                                   id        Primary Key
                                                                     1


                                             Primary Key


       ?                                                        id


       ?              id   Primary Key
           (“WHERE user_id=10001”        )




2011   3   5
auto_increment

       ?


           ID

               CREATE TABLE seq_history(
                  seq_id bigint unsigned not null
               );

       ? auto_increment
           MySQL5.1                                 DB
                 auto_increment




2011   3   5
Read       Write

       ? Read(SELECT)       DB
               Write       DB              DB



       ?           Write         SELECT



       ?                          SELECT




       ?                          Read
                                            Write

2011   3   5
?       Read/Write   SQL




       ?
                                  IO




           →
           →




2011   3   5
MySQL

       ?       DB                                                                   DB
                                         DB


                                   DB                                                    DB



                                                                     (3)Relay Log
                (1)           (INSERT,UPDATE   )
                                                                         SQL
                      Binary Log

                                                                       SQL
                                                    IO
                Binary Log
                                                                               Relay Log
                                                   (2)IO    Binary
                                                   Log
                                                       DB




2011   3   5
DB

       ?        DB                  DB
           →MySQL         1


       ?




           →                  SSD        cf.




2011   3   5
?
                           NG

       UPDATE history_tbl SET state = 2 WHERE state = 1 LIMIT 10

       →state=1



       UPDATE history_tbl SET state = 2 ORDER BY finish_time LIMIT 1

       →                  ?nish_time



       ? UPDATE        WHERE      Primary Key




2011   3   5

More Related Content

More from Naoyuki Yamada (18)

碍耻产别谤苍别迟别蝉で搁别诲颈蝉を使うときの选択肢
碍耻产别谤苍别迟别蝉で搁别诲颈蝉を使うときの选択肢碍耻产别谤苍别迟别蝉で搁别诲颈蝉を使うときの选択肢
碍耻产别谤苍别迟别蝉で搁别诲颈蝉を使うときの选択肢
Naoyuki Yamada
?
いわき情报技术研究会20170513
いわき情报技术研究会20170513いわき情报技术研究会20170513
いわき情报技术研究会20170513
Naoyuki Yamada
?
浪江町タブレットで採用した、 Cordovaで作るHTML5のAndroidアプリのしくみ
浪江町タブレットで採用した、 Cordovaで作るHTML5のAndroidアプリのしくみ浪江町タブレットで採用した、 Cordovaで作るHTML5のAndroidアプリのしくみ
浪江町タブレットで採用した、 Cordovaで作るHTML5のAndroidアプリのしくみ
Naoyuki Yamada
?
东北罢别肠丑道场郡山20151031
东北罢别肠丑道场郡山20151031东北罢别肠丑道场郡山20151031
东北罢别肠丑道场郡山20151031
Naoyuki Yamada
?
AWSからOpenStack, Chef SoloからChef Serverに インフラを置き換えた事例の紹介
AWSからOpenStack, Chef SoloからChef Serverに インフラを置き換えた事例の紹介AWSからOpenStack, Chef SoloからChef Serverに インフラを置き換えた事例の紹介
AWSからOpenStack, Chef SoloからChef Serverに インフラを置き換えた事例の紹介
Naoyuki Yamada
?
Elasticsearch勉強会第8回 ElasticsearchとKibanaで実現する 30億req/dayのリアルタイム分析
Elasticsearch勉強会第8回 ElasticsearchとKibanaで実現する 30億req/dayのリアルタイム分析Elasticsearch勉強会第8回 ElasticsearchとKibanaで実現する 30億req/dayのリアルタイム分析
Elasticsearch勉強会第8回 ElasticsearchとKibanaで実現する 30億req/dayのリアルタイム分析
Naoyuki Yamada
?
CAジャーナルクラブ TAO: Facebook’s Distributed Data Store for the Social Graph
CAジャーナルクラブ TAO: Facebook’s Distributed Data Store for the Social GraphCAジャーナルクラブ TAO: Facebook’s Distributed Data Store for the Social Graph
CAジャーナルクラブ TAO: Facebook’s Distributed Data Store for the Social Graph
Naoyuki Yamada
?
Adtech College#7 GitHubを中心とした開発フロー
Adtech College#7 GitHubを中心とした開発フローAdtech College#7 GitHubを中心とした開発フロー
Adtech College#7 GitHubを中心とした開発フロー
Naoyuki Yamada
?
ElasticSearch勉強会 第6回
ElasticSearch勉強会 第6回ElasticSearch勉強会 第6回
ElasticSearch勉強会 第6回
Naoyuki Yamada
?
CAジャーナルクラブ Dremel: Interactive Analysis of Web-Scale Datasets
CAジャーナルクラブ Dremel: Interactive Analysis of Web-Scale DatasetsCAジャーナルクラブ Dremel: Interactive Analysis of Web-Scale Datasets
CAジャーナルクラブ Dremel: Interactive Analysis of Web-Scale Datasets
Naoyuki Yamada
?
ADTECH COLLEGE #2 近い将来、開発責任者になるあなたへ
ADTECH COLLEGE #2 近い将来、開発責任者になるあなたへADTECH COLLEGE #2 近い将来、開発責任者になるあなたへ
ADTECH COLLEGE #2 近い将来、開発責任者になるあなたへ
Naoyuki Yamada
?
株式会社サイバーエージェント アドテクスタジオの技術と開発
株式会社サイバーエージェント アドテクスタジオの技術と開発株式会社サイバーエージェント アドテクスタジオの技術と開発
株式会社サイバーエージェント アドテクスタジオの技術と開発
Naoyuki Yamada
?
Functional Programming in Scala Reading #2
Functional Programming in Scala Reading #2Functional Programming in Scala Reading #2
Functional Programming in Scala Reading #2
Naoyuki Yamada
?
Code for Japan 勉強会 Vol.1 CKAN入門 プロジェクトのFork、デプロイ、CIまで
Code for Japan 勉強会 Vol.1 CKAN入門 プロジェクトのFork、デプロイ、CIまでCode for Japan 勉強会 Vol.1 CKAN入門 プロジェクトのFork、デプロイ、CIまで
Code for Japan 勉強会 Vol.1 CKAN入門 プロジェクトのFork、デプロイ、CIまで
Naoyuki Yamada
?
JAWS-2013-LT 10000req/secを50msecで返すサーバーインフラをAWSで作る
JAWS-2013-LT 10000req/secを50msecで返すサーバーインフラをAWSで作るJAWS-2013-LT 10000req/secを50msecで返すサーバーインフラをAWSで作る
JAWS-2013-LT 10000req/secを50msecで返すサーバーインフラをAWSで作る
Naoyuki Yamada
?
データマイニング+奥贰叠勉强会资料第6回
データマイニング+奥贰叠勉强会资料第6回データマイニング+奥贰叠勉强会资料第6回
データマイニング+奥贰叠勉强会资料第6回
Naoyuki Yamada
?
Social Web Japan Vol.3 "Social Application and their support services"
Social Web Japan Vol.3 "Social Application and their support services"Social Web Japan Vol.3 "Social Application and their support services"
Social Web Japan Vol.3 "Social Application and their support services"
Naoyuki Yamada
?
ソーシャルアプリ业界を构成する中间サービスたち
ソーシャルアプリ业界を构成する中间サービスたちソーシャルアプリ业界を构成する中间サービスたち
ソーシャルアプリ业界を构成する中间サービスたち
Naoyuki Yamada
?
碍耻产别谤苍别迟别蝉で搁别诲颈蝉を使うときの选択肢
碍耻产别谤苍别迟别蝉で搁别诲颈蝉を使うときの选択肢碍耻产别谤苍别迟别蝉で搁别诲颈蝉を使うときの选択肢
碍耻产别谤苍别迟别蝉で搁别诲颈蝉を使うときの选択肢
Naoyuki Yamada
?
いわき情报技术研究会20170513
いわき情报技术研究会20170513いわき情报技术研究会20170513
いわき情报技术研究会20170513
Naoyuki Yamada
?
浪江町タブレットで採用した、 Cordovaで作るHTML5のAndroidアプリのしくみ
浪江町タブレットで採用した、 Cordovaで作るHTML5のAndroidアプリのしくみ浪江町タブレットで採用した、 Cordovaで作るHTML5のAndroidアプリのしくみ
浪江町タブレットで採用した、 Cordovaで作るHTML5のAndroidアプリのしくみ
Naoyuki Yamada
?
东北罢别肠丑道场郡山20151031
东北罢别肠丑道场郡山20151031东北罢别肠丑道场郡山20151031
东北罢别肠丑道场郡山20151031
Naoyuki Yamada
?
AWSからOpenStack, Chef SoloからChef Serverに インフラを置き換えた事例の紹介
AWSからOpenStack, Chef SoloからChef Serverに インフラを置き換えた事例の紹介AWSからOpenStack, Chef SoloからChef Serverに インフラを置き換えた事例の紹介
AWSからOpenStack, Chef SoloからChef Serverに インフラを置き換えた事例の紹介
Naoyuki Yamada
?
Elasticsearch勉強会第8回 ElasticsearchとKibanaで実現する 30億req/dayのリアルタイム分析
Elasticsearch勉強会第8回 ElasticsearchとKibanaで実現する 30億req/dayのリアルタイム分析Elasticsearch勉強会第8回 ElasticsearchとKibanaで実現する 30億req/dayのリアルタイム分析
Elasticsearch勉強会第8回 ElasticsearchとKibanaで実現する 30億req/dayのリアルタイム分析
Naoyuki Yamada
?
CAジャーナルクラブ TAO: Facebook’s Distributed Data Store for the Social Graph
CAジャーナルクラブ TAO: Facebook’s Distributed Data Store for the Social GraphCAジャーナルクラブ TAO: Facebook’s Distributed Data Store for the Social Graph
CAジャーナルクラブ TAO: Facebook’s Distributed Data Store for the Social Graph
Naoyuki Yamada
?
Adtech College#7 GitHubを中心とした開発フロー
Adtech College#7 GitHubを中心とした開発フローAdtech College#7 GitHubを中心とした開発フロー
Adtech College#7 GitHubを中心とした開発フロー
Naoyuki Yamada
?
ElasticSearch勉強会 第6回
ElasticSearch勉強会 第6回ElasticSearch勉強会 第6回
ElasticSearch勉強会 第6回
Naoyuki Yamada
?
CAジャーナルクラブ Dremel: Interactive Analysis of Web-Scale Datasets
CAジャーナルクラブ Dremel: Interactive Analysis of Web-Scale DatasetsCAジャーナルクラブ Dremel: Interactive Analysis of Web-Scale Datasets
CAジャーナルクラブ Dremel: Interactive Analysis of Web-Scale Datasets
Naoyuki Yamada
?
ADTECH COLLEGE #2 近い将来、開発責任者になるあなたへ
ADTECH COLLEGE #2 近い将来、開発責任者になるあなたへADTECH COLLEGE #2 近い将来、開発責任者になるあなたへ
ADTECH COLLEGE #2 近い将来、開発責任者になるあなたへ
Naoyuki Yamada
?
株式会社サイバーエージェント アドテクスタジオの技術と開発
株式会社サイバーエージェント アドテクスタジオの技術と開発株式会社サイバーエージェント アドテクスタジオの技術と開発
株式会社サイバーエージェント アドテクスタジオの技術と開発
Naoyuki Yamada
?
Functional Programming in Scala Reading #2
Functional Programming in Scala Reading #2Functional Programming in Scala Reading #2
Functional Programming in Scala Reading #2
Naoyuki Yamada
?
Code for Japan 勉強会 Vol.1 CKAN入門 プロジェクトのFork、デプロイ、CIまで
Code for Japan 勉強会 Vol.1 CKAN入門 プロジェクトのFork、デプロイ、CIまでCode for Japan 勉強会 Vol.1 CKAN入門 プロジェクトのFork、デプロイ、CIまで
Code for Japan 勉強会 Vol.1 CKAN入門 プロジェクトのFork、デプロイ、CIまで
Naoyuki Yamada
?
JAWS-2013-LT 10000req/secを50msecで返すサーバーインフラをAWSで作る
JAWS-2013-LT 10000req/secを50msecで返すサーバーインフラをAWSで作るJAWS-2013-LT 10000req/secを50msecで返すサーバーインフラをAWSで作る
JAWS-2013-LT 10000req/secを50msecで返すサーバーインフラをAWSで作る
Naoyuki Yamada
?
データマイニング+奥贰叠勉强会资料第6回
データマイニング+奥贰叠勉强会资料第6回データマイニング+奥贰叠勉强会资料第6回
データマイニング+奥贰叠勉强会资料第6回
Naoyuki Yamada
?
Social Web Japan Vol.3 "Social Application and their support services"
Social Web Japan Vol.3 "Social Application and their support services"Social Web Japan Vol.3 "Social Application and their support services"
Social Web Japan Vol.3 "Social Application and their support services"
Naoyuki Yamada
?
ソーシャルアプリ业界を构成する中间サービスたち
ソーシャルアプリ业界を构成する中间サービスたちソーシャルアプリ业界を构成する中间サービスたち
ソーシャルアプリ业界を构成する中间サービスたち
Naoyuki Yamada
?

Recently uploaded (20)

SECURE BLOCKCHAIN FOR ADMISSION PROCESSING IN EDUCATIONAL INSTITUTIONS.pdf
SECURE BLOCKCHAIN FOR ADMISSION PROCESSING IN EDUCATIONAL INSTITUTIONS.pdfSECURE BLOCKCHAIN FOR ADMISSION PROCESSING IN EDUCATIONAL INSTITUTIONS.pdf
SECURE BLOCKCHAIN FOR ADMISSION PROCESSING IN EDUCATIONAL INSTITUTIONS.pdf
spub1985
?
SB7 Mobile Ltd: Simplified & Secure Services
SB7 Mobile Ltd: Simplified & Secure ServicesSB7 Mobile Ltd: Simplified & Secure Services
SB7 Mobile Ltd: Simplified & Secure Services
Reuben Jasper
?
NSFW AI Chatbot Development Costs: What You Need to Know
NSFW AI Chatbot Development Costs: What You Need to KnowNSFW AI Chatbot Development Costs: What You Need to Know
NSFW AI Chatbot Development Costs: What You Need to Know
Soulmaite
?
Supercharge Your Career with UiPath Certifications
Supercharge Your Career with UiPath CertificationsSupercharge Your Career with UiPath Certifications
Supercharge Your Career with UiPath Certifications
DianaGray10
?
Not a Kubernetes fan? The state of PaaS in 2025
Not a Kubernetes fan? The state of PaaS in 2025Not a Kubernetes fan? The state of PaaS in 2025
Not a Kubernetes fan? The state of PaaS in 2025
Anthony Dahanne
?
2025-02-24 - AWS meetup - Zilliz presentation.pdf
2025-02-24 - AWS meetup - Zilliz presentation.pdf2025-02-24 - AWS meetup - Zilliz presentation.pdf
2025-02-24 - AWS meetup - Zilliz presentation.pdf
Ivan Tang
?
AI Trends and Fun Demos – Sotheby’s Rehoboth Presentation
AI Trends and Fun Demos – Sotheby’s Rehoboth PresentationAI Trends and Fun Demos – Sotheby’s Rehoboth Presentation
AI Trends and Fun Demos – Sotheby’s Rehoboth Presentation
Ethan Holland
?
Kickstart Your QA: An Introduction to Automated Regression Testing Tools
Kickstart Your QA: An Introduction to Automated Regression Testing ToolsKickstart Your QA: An Introduction to Automated Regression Testing Tools
Kickstart Your QA: An Introduction to Automated Regression Testing Tools
Shubham Joshi
?
Webinar: LF Energy GEISA: Addressing edge interoperability at the meter
Webinar: LF Energy GEISA: Addressing edge interoperability at the meterWebinar: LF Energy GEISA: Addressing edge interoperability at the meter
Webinar: LF Energy GEISA: Addressing edge interoperability at the meter
DanBrown980551
?
Transcript: AI in publishing: Your questions answered - Tech Forum 2025
Transcript: AI in publishing: Your questions answered - Tech Forum 2025Transcript: AI in publishing: Your questions answered - Tech Forum 2025
Transcript: AI in publishing: Your questions answered - Tech Forum 2025
BookNet Canada
?
Data-Driven Public Safety: Reliable Data When Every Second Counts
Data-Driven Public Safety: Reliable Data When Every Second CountsData-Driven Public Safety: Reliable Data When Every Second Counts
Data-Driven Public Safety: Reliable Data When Every Second Counts
Safe Software
?
Mastering ChatGPT & LLMs for Practical Applications: Tips, Tricks, and Use Cases
Mastering ChatGPT & LLMs for Practical Applications: Tips, Tricks, and Use CasesMastering ChatGPT & LLMs for Practical Applications: Tips, Tricks, and Use Cases
Mastering ChatGPT & LLMs for Practical Applications: Tips, Tricks, and Use Cases
Sanjay Willie
?
Blockchain for Businesses Practical Use Cases & Benefits.pdf
Blockchain for Businesses Practical Use Cases & Benefits.pdfBlockchain for Businesses Practical Use Cases & Benefits.pdf
Blockchain for Businesses Practical Use Cases & Benefits.pdf
Yodaplus Technologies Private Limited
?
Caching for Performance Masterclass: Caching at Scale
Caching for Performance Masterclass: Caching at ScaleCaching for Performance Masterclass: Caching at Scale
Caching for Performance Masterclass: Caching at Scale
ScyllaDB
?
UiPath Automation Developer Associate Training Series 2025 - Session 1
UiPath Automation Developer Associate Training Series 2025 - Session 1UiPath Automation Developer Associate Training Series 2025 - Session 1
UiPath Automation Developer Associate Training Series 2025 - Session 1
DianaGray10
?
What is Blockchain and How Can Blockchain Consulting Help Businesses.pdf
What is Blockchain and How Can Blockchain Consulting Help Businesses.pdfWhat is Blockchain and How Can Blockchain Consulting Help Businesses.pdf
What is Blockchain and How Can Blockchain Consulting Help Businesses.pdf
Yodaplus Technologies Private Limited
?
Combining Lexical and Semantic Search with Milvus 2.5
Combining Lexical and Semantic Search with Milvus 2.5Combining Lexical and Semantic Search with Milvus 2.5
Combining Lexical and Semantic Search with Milvus 2.5
Zilliz
?
The Constructor's Digital Transformation Playbook: Reducing Risk With Technology
The Constructor's Digital Transformation Playbook: Reducing Risk With TechnologyThe Constructor's Digital Transformation Playbook: Reducing Risk With Technology
The Constructor's Digital Transformation Playbook: Reducing Risk With Technology
Aggregage
?
Revolutionizing Field Service: How LLMs Are Powering Smarter Knowledge Access...
Revolutionizing Field Service: How LLMs Are Powering Smarter Knowledge Access...Revolutionizing Field Service: How LLMs Are Powering Smarter Knowledge Access...
Revolutionizing Field Service: How LLMs Are Powering Smarter Knowledge Access...
Earley Information Science
?
Bedrock Data Automation (Preview): Simplifying Unstructured Data Processing
Bedrock Data Automation (Preview): Simplifying Unstructured Data ProcessingBedrock Data Automation (Preview): Simplifying Unstructured Data Processing
Bedrock Data Automation (Preview): Simplifying Unstructured Data Processing
Zilliz
?
SECURE BLOCKCHAIN FOR ADMISSION PROCESSING IN EDUCATIONAL INSTITUTIONS.pdf
SECURE BLOCKCHAIN FOR ADMISSION PROCESSING IN EDUCATIONAL INSTITUTIONS.pdfSECURE BLOCKCHAIN FOR ADMISSION PROCESSING IN EDUCATIONAL INSTITUTIONS.pdf
SECURE BLOCKCHAIN FOR ADMISSION PROCESSING IN EDUCATIONAL INSTITUTIONS.pdf
spub1985
?
SB7 Mobile Ltd: Simplified & Secure Services
SB7 Mobile Ltd: Simplified & Secure ServicesSB7 Mobile Ltd: Simplified & Secure Services
SB7 Mobile Ltd: Simplified & Secure Services
Reuben Jasper
?
NSFW AI Chatbot Development Costs: What You Need to Know
NSFW AI Chatbot Development Costs: What You Need to KnowNSFW AI Chatbot Development Costs: What You Need to Know
NSFW AI Chatbot Development Costs: What You Need to Know
Soulmaite
?
Supercharge Your Career with UiPath Certifications
Supercharge Your Career with UiPath CertificationsSupercharge Your Career with UiPath Certifications
Supercharge Your Career with UiPath Certifications
DianaGray10
?
Not a Kubernetes fan? The state of PaaS in 2025
Not a Kubernetes fan? The state of PaaS in 2025Not a Kubernetes fan? The state of PaaS in 2025
Not a Kubernetes fan? The state of PaaS in 2025
Anthony Dahanne
?
2025-02-24 - AWS meetup - Zilliz presentation.pdf
2025-02-24 - AWS meetup - Zilliz presentation.pdf2025-02-24 - AWS meetup - Zilliz presentation.pdf
2025-02-24 - AWS meetup - Zilliz presentation.pdf
Ivan Tang
?
AI Trends and Fun Demos – Sotheby’s Rehoboth Presentation
AI Trends and Fun Demos – Sotheby’s Rehoboth PresentationAI Trends and Fun Demos – Sotheby’s Rehoboth Presentation
AI Trends and Fun Demos – Sotheby’s Rehoboth Presentation
Ethan Holland
?
Kickstart Your QA: An Introduction to Automated Regression Testing Tools
Kickstart Your QA: An Introduction to Automated Regression Testing ToolsKickstart Your QA: An Introduction to Automated Regression Testing Tools
Kickstart Your QA: An Introduction to Automated Regression Testing Tools
Shubham Joshi
?
Webinar: LF Energy GEISA: Addressing edge interoperability at the meter
Webinar: LF Energy GEISA: Addressing edge interoperability at the meterWebinar: LF Energy GEISA: Addressing edge interoperability at the meter
Webinar: LF Energy GEISA: Addressing edge interoperability at the meter
DanBrown980551
?
Transcript: AI in publishing: Your questions answered - Tech Forum 2025
Transcript: AI in publishing: Your questions answered - Tech Forum 2025Transcript: AI in publishing: Your questions answered - Tech Forum 2025
Transcript: AI in publishing: Your questions answered - Tech Forum 2025
BookNet Canada
?
Data-Driven Public Safety: Reliable Data When Every Second Counts
Data-Driven Public Safety: Reliable Data When Every Second CountsData-Driven Public Safety: Reliable Data When Every Second Counts
Data-Driven Public Safety: Reliable Data When Every Second Counts
Safe Software
?
Mastering ChatGPT & LLMs for Practical Applications: Tips, Tricks, and Use Cases
Mastering ChatGPT & LLMs for Practical Applications: Tips, Tricks, and Use CasesMastering ChatGPT & LLMs for Practical Applications: Tips, Tricks, and Use Cases
Mastering ChatGPT & LLMs for Practical Applications: Tips, Tricks, and Use Cases
Sanjay Willie
?
Caching for Performance Masterclass: Caching at Scale
Caching for Performance Masterclass: Caching at ScaleCaching for Performance Masterclass: Caching at Scale
Caching for Performance Masterclass: Caching at Scale
ScyllaDB
?
UiPath Automation Developer Associate Training Series 2025 - Session 1
UiPath Automation Developer Associate Training Series 2025 - Session 1UiPath Automation Developer Associate Training Series 2025 - Session 1
UiPath Automation Developer Associate Training Series 2025 - Session 1
DianaGray10
?
Combining Lexical and Semantic Search with Milvus 2.5
Combining Lexical and Semantic Search with Milvus 2.5Combining Lexical and Semantic Search with Milvus 2.5
Combining Lexical and Semantic Search with Milvus 2.5
Zilliz
?
The Constructor's Digital Transformation Playbook: Reducing Risk With Technology
The Constructor's Digital Transformation Playbook: Reducing Risk With TechnologyThe Constructor's Digital Transformation Playbook: Reducing Risk With Technology
The Constructor's Digital Transformation Playbook: Reducing Risk With Technology
Aggregage
?
Revolutionizing Field Service: How LLMs Are Powering Smarter Knowledge Access...
Revolutionizing Field Service: How LLMs Are Powering Smarter Knowledge Access...Revolutionizing Field Service: How LLMs Are Powering Smarter Knowledge Access...
Revolutionizing Field Service: How LLMs Are Powering Smarter Knowledge Access...
Earley Information Science
?
Bedrock Data Automation (Preview): Simplifying Unstructured Data Processing
Bedrock Data Automation (Preview): Simplifying Unstructured Data ProcessingBedrock Data Automation (Preview): Simplifying Unstructured Data Processing
Bedrock Data Automation (Preview): Simplifying Unstructured Data Processing
Zilliz
?

社内勉强会:ソーシャルゲームのデータベース设计入门

  • 1. 2011 3 4 2011 3 5
  • 2. ? DB ? Index Index Covering Index Primary Key Read Write ? MySQL DB SQL 2011 3 5
  • 3. ? →(10001,A) ※ ? Primary Key →Primary Key ? Primary Key 2011 3 5
  • 4. ? ID ID 1 1 2 2 2 2011 3 5
  • 5. ? ID ID 1 10001 1 10002 2 10001 ID ID 1 10001 2 10002 1 10002 2 10001 2 10002 ID 10001 10002 2011 3 5
  • 6. ? ID ID 1 101 2 102 ID ID 3 103 1 101 4 102 2 102 3 103 4 102 ID 101 102 103 2011 3 5
  • 7. ALTER TABLE ? ? (ALTER TABLE) →ALTER TABLE ? ? → 2011 3 5
  • 8. ID ID 1 1 101 1 1 2 234 2 1 3 553 3 1 4 232 4 2 1 102 2 2 271 2 3 952 ID 1 101 234 553 232 873 0 102 0 2 102 271 8652 98 0 234 202 0 3 103 952 76 765 872 45 0 0 4 102 197 2312 762 4 232 672 34 ? 2011 3 5
  • 9. Index ? WHERE Index Primary Key WHERE user_id = 10001 → user_id Index( Primary Key) WHERE user_id = 10001 AND friend_id = 10002 → (user_id, friend_id) WHERE visiting_id = 10001 AND visited_id IN (1,2,3) AND action=2 → (visiting_id,visited_id,action) WHERE status = 2 ORDER BY start_time → (status,start_time) 2011 3 5
  • 10. Index ? Index WHERE start_time < 12345678 AND state = 2 →(start_time,state) (state,start_time) ? Index WHERE visited_id = 10002 AND visiting_id = 10001 AND action=2 → (visiting_id,visited_id,action) ? Index WHERE visiting_id = 10001 AND action = 2 AND visited_id = 10002 → (visiting_id,visited_id,action) Index visiting_id 2011 3 5
  • 11. Covering Index ? MySQL Covering Index - ( ? )o sasata299's blog http://blog.livedoor.jp/sasata299/archives/51336006.html ? Covering Index → 2011 3 5
  • 12. Primary Key id ? Primary Key → Primary Key MySQL id Primary Key MySQL :: MySQL 5.1 :: 13.5.13 InnoDB http://dev.mysql.com/doc/refman/5.1/ja/innodb-table-and-index.html ? id WHERE id IN (a,b,c,d...) ? id id Primary Key ( Covering Index ) 2011 3 5
  • 13. Primary Key ? id Primary Key 1 Primary Key ? id ? id Primary Key (“WHERE user_id=10001” ) 2011 3 5
  • 14. auto_increment ? ID CREATE TABLE seq_history( seq_id bigint unsigned not null ); ? auto_increment MySQL5.1 DB auto_increment 2011 3 5
  • 15. Read Write ? Read(SELECT) DB Write DB DB ? Write SELECT ? SELECT ? Read Write 2011 3 5
  • 16. ? Read/Write SQL ? IO → → 2011 3 5
  • 17. MySQL ? DB DB DB DB DB (3)Relay Log (1) (INSERT,UPDATE ) SQL Binary Log SQL IO Binary Log Relay Log (2)IO Binary Log DB 2011 3 5
  • 18. DB ? DB DB →MySQL 1 ? → SSD cf. 2011 3 5
  • 19. ? NG UPDATE history_tbl SET state = 2 WHERE state = 1 LIMIT 10 →state=1 UPDATE history_tbl SET state = 2 ORDER BY finish_time LIMIT 1 → ?nish_time ? UPDATE WHERE Primary Key 2011 3 5