📋
space
  • SDE Interview
  • Multi-threading
    • Mutex vs Semorphore
    • Thread vs process
  • Design Pattern
  • Java
    • Polymorphism
    • Encapsulation
    • Inheritance
    • Override vs overload
  • MySQL
    • DB transaction
  • Data Structure
    • Design hashset
    • AVL / red black tree
    • LinkedList vs arrayList
    • HashMap vs HashTable
    • Binary Tree
    • Heap
  • System Design
    • Session Cookie
    • GFS / BigTable / MapReduce
    • Zookeeper
    • gRPC vs thrift
    • Amazon RDS vs Oracle
    • Microservices
    • REST vs RPC
    • Database design
    • idempotent in HTTP
    • Optimistic locking / Pessimistic locking
    • Partitioning / Sharding data
    • Consistent Hashing
    • Case Study
      • Design Delay Task scheduler
      • Design View Count
      • Design Twitter
      • Design Web Crawler
      • Design Uber
      • Design Netflix
      • Design Google Doc
      • Design Monitoring System
      • Design Dropbox
      • Distributed Lock
      • Design Instagram
      • Design Yelp
      • Design Amazon
      • Design Google Search
      • Distributed Database System Key Value Store
      • Design Facebook message / Whatsapp
      • Design Logging Systems
      • Design Movie booking system
      • Design Google Autocomplete Feature
      • Design Twitter Search
    • Message Broker
      • Kafka
    • Design Data Intensive Application
      • Chapter 8
    • SQL vs NoSQL
      • Cassandra
      • MongoDB vs Cassandra vs MySQL vs HBase
    • TCP vs UDP
    • Load Balancer
    • Cache
      • Memcached
      • Redis
    • DNS
    • CDN
    • Strong consistency vs eventual consistency
    • Scalability
Powered by GitBook
On this page

Was this helpful?

MySQL

PreviousOverride vs overloadNextDB transaction

Last updated 4 years ago

Was this helpful?

  • 为什么mysql index要用b+, 不用b?

    • 哈希虽然能够提供 O(1) 的单数据行操作性能,但是对于范围查询和排序却无法很好地支持,最终导致全表扫描;

    • B 树能够在非叶节点中存储数据,但是这也导致在查询连续数据时可能会带来更多的随机 I/O,而 B+ 树的所有叶节点可以通过指针相互连接,能够减少顺序遍历时产生的额外随机 I/O;

  • MySQL 怎么做index

  • MySQL 有哪些种类index

    • Mysql共支持五种索引类型:

      PRIMARY KEY 主键索引

      INDEX 普通索引

      UNIQUE 唯一索引

      FULLTEXT 全文索引

      组合索引(较特殊)

  • MySQL 隔离等级有哪些

    • MySQL isolation levels有read committed, snapshot isolation (repeatable read), serializable isolation.

  • MySQL 默认隔离等级是什么?有什么优点?会出现什么现象?

    • MySQL默认的isolation level是snapshot isolation (repeatable read)

    • 但是没法解决write skew or phantom的anomaly, 并且由于是read consistent snapshot所以没有linearizable guarantee, 另外MVCC本身不知道算不算是一种cost毕竟要maintain 很多不同的committed versions

    • 可以幻读

  • DB transaction / ACID

  • MySQL 的锁

https://draveness.me/whys-the-design-mysql-b-plus-tree/
https://en.wikipedia.org/wiki/Database_transaction
https://developer.ibm.com/zh/technologies/databases/articles/os-mysql-transaction-isolation-levels-and-locks/