Giter Club home page Giter Club logo

isucon13's People

Contributors

daylight55 avatar vvani06 avatar

Watchers

 avatar  avatar

isucon13's Issues

[DB] `SELECT livestreams livecomments` スロークエリの改善

初回のスロークエリログの2番手
https://github.com/vvani06/isucon13/blob/main/mysql/digest_20231125-043157.txt

# Query 2: 577.72 QPS, 0.78x concurrency, ID 0xFD38427AE3D09E3883A680F7BAF95D3A at byte 103249723
# This item is included in the report because it matches --limit.
# Scores: V/M = 0.00
# Time range: 2023-11-25T04:28:13 to 2023-11-25T04:30:50
# Attribute    pct   total     min     max     avg     95%  stddev  median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count         27   90702
# Exec time     12    122s   292us    18ms     1ms     3ms   989us   972us
# Lock time     15   151ms       0     4ms     1us     1us    27us     1us
# Rows sent     22  88.58k       1       1       1       1       0       1
# Rows examine  31 102.27M    1001   1.19k   1.15k   1.14k   77.20   1.14k
# Query size    19  10.54M     119     122  121.85  118.34       0  118.34
# String:
# Databases    isupipe
# Hosts        localhost
# Users        isucon
# Query_time distribution
#   1us
#  10us
# 100us  ##############################################################
#   1ms  ################################################################
#  10ms  #
# 100ms
#    1s
#  10s+
# Tables
#    SHOW TABLE STATUS FROM `isupipe` LIKE 'livestreams'\G
#    SHOW CREATE TABLE `isupipe`.`livestreams`\G
#    SHOW TABLE STATUS FROM `isupipe` LIKE 'livecomments'\G
#    SHOW CREATE TABLE `isupipe`.`livecomments`\G
# EXPLAIN /*!50100 PARTITIONS*/
SELECT IFNULL(SUM(l2.tip), 0) FROM livestreams l INNER JOIN livecomments l2 ON l.id = l2.livestream_id WHERE l.id = '239'\G

テーブル定義はこちら。インデックスは貼られてなさそうな感じ
https://github.com/vvani06/isucon13/blob/main/sql/initdb.d/10_schema.sql

[DB] livestream_tags のスロークエリを改善する

初回のスロークエリログの筆頭
https://github.com/vvani06/isucon13/blob/main/mysql/digest_20231125-043157.txt

# Query 1: 60.72 QPS, 2.47x concurrency, ID 0xF7144185D9A142A426A36DC55C1D2623 at byte 67959722
# This item is included in the report because it matches --limit.
# Scores: V/M = 0.02
# Time range: 2023-11-25T04:28:11 to 2023-11-25T04:29:49
# Attribute    pct   total     min     max     avg     95%  stddev  median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count          1    5951
# Exec time     24    242s     2ms   182ms    41ms    87ms    29ms    40ms
# Lock time      3    36ms       0    20ms     6us     1us   263us     1us
# Rows sent      5  20.88k       0      11    3.59    4.96    1.84    4.96
# Rows examine  19  63.05M  10.71k  11.00k  10.85k  10.80k     151  10.80k
# Query size     0 336.84k      55      58   57.96   56.92    0.17   56.92
# String:
# Databases    isupipe
# Hosts        localhost
# Users        isucon
# Query_time distribution
#   1us
#  10us
# 100us
#   1ms  #####################
#  10ms  ################################################################
# 100ms  ###
#    1s
#  10s+
# Tables
#    SHOW TABLE STATUS FROM `isupipe` LIKE 'livestream_tags'\G
#    SHOW CREATE TABLE `isupipe`.`livestream_tags`\G
# EXPLAIN /*!50100 PARTITIONS*/
SELECT * FROM livestream_tags WHERE livestream_id = '7523'\G

テーブルそのものは単純なカラムしかない、インデックスはれたら効きそうだがどうか
https://github.com/vvani06/isucon13/blob/main/sql/initdb.d/10_schema.sql

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.