• Suicide
  • having no backups
  • depending on slaves for backup
  • keeping backups on same SAN
  • having a single DBA – Frank didn't like this one at all
  • not keeping binlogs
  • Restoring from backup
    • how much time?
    • uncompressed backup ready to mount?
    • separate network for recovery?
  • In Fotolog, 1TB of data was severely hit.
    • first problem: backup was highly compressed (tar.gz)
    • uncompressing took hours
    • so keep uncompressed backups (at least last N days)
    • it should be mountable, rather than transferable
  • Frank going over recovery modes at http://dev.mysql.com/doc/refman/5.0/en/forcing-recovery.html
  • Row by row recovery
    • row by row recovery (get the range of ids)
    • custom scripts
    • may not be able to use primary key
    • foreign key based retrieval faster
    • lose 4 seconds for each crashed record
    • Read the rest of this article »

    0

    MySQL Conference: Presentation At The Kickfire Booth


    Posted by Artem Russakovskii on April 15th, 2008 in Databases

    Updated: April 17th, 2008

    I had a chance to visit the Kickfire booth after the keynotes and before the first presentation. They gave me a kicking t-shirt, followed by a presentation on the newly announced Kickfire appliance (now in beta, shipping in Fall 2008). Here are some notes I jotted down:

    • von Neumann bottleneck
    • SQL chip (SQC), packs the power of 10s of conventional CPUs
    • Query parallelization on the chip
    • On-chip memory – 64GB. No registers – no von Neumann bottleneck
    • Beats the performance of a given 3 server, 32 CPU, 130TB box (1TB of actual data – space is used for distributing IO)
    • SQC uses column-store, compression, intelligent indexing
    • SQL Chip, PCI connection, plugs into a Linux server
      • SQL execution
      • Memory management
      • Loader
    • Read the rest of this article »

    1

    MySQL Conference Liveblogging: EXPLAIN Demystified (Tuesday 2:00PM)


    Posted by Artem Russakovskii on April 15th, 2008 in Databases

    • Baron Schwartz presents
    • only works for SELECTs
    • nobody dares admit if they've never seen EXPLAIN
    • MySQL actually executes the query
    • at each JOIN, instead of executing the query, it fills the EXPLAIN result set
    • everything is a JOIN (even SELECT 1)
    • Columns in EXPLAIN
    • id: which SELECT the row belongs to
    • select_type
    • simple
    • subquery
    • derived
    • union
    • union result
  • table: the table accessed or its alias
  • type:
    • join
    • range
  • possible_keys: which indexes looked useful to the optimizer
  • key: which index(es) the optimizer chose
  • key_len: the number of bytes of the index MySQL will use
  • ref: which columns/constants from preceding tables are used for lookups in the index named in the key column
  • rows: estimated number of rows to read
  • extra…

    Read the rest of this article »

  • 0

    MySQL Conference Liveblogging: The Future Of MySQL (Tuesday 11:55AM)


    Posted by Artem Russakovskii on April 15th, 2008 in Databases

    • Robin Schumacher
    • gives overview of MySQL products
    • MySQL Enterprise
    • MySQL 5.1 announced
      • table/index partitioning -> great for data warehouses, range, cache, key, list, composite, subpartitioning. Partition pruning. Response time greatly improved with proper partitioning.
      • row-based/hybrid replication -> safer and smarter
      • disk-based cluster -> supports bigger DBs
      • built-in job scheduler -> simplified task management
      • problem SQL identification -> easier troubleshooting. Dynamic query tracing is now available, no need to trace things in slow query logs.
      • faster full-text search -> 500% increase in some cases
      • 5.1.24RC available for the conference
    • MySQL 6.0
      • Falcon engine – transactional engine
      • new backup (version 1.0) -> cross engine, non-blocking, to replace mysqldump
    • Falcon
      • planned default transactional storage engine. Q4 GA (general availability).
      • not InnoDB replacement
      • most
    • Read the rest of this article »

    • Speaker: Mikael Ronstrom, PhD, the creator of the Cluster engine
    • Explains the cluster structure
    • Aspects of performance
      • Response times
      • Throughput
      • Low variation of response times
    • Improving performance
      • use low level API (NDB API), expensive, hard
      • use new features in MySQL Cluster Carrier Grade Edition 6.3 (currently 6.3.13), more on this later
      • proper partitioning of tables, minimize communication
      • use of hardware
    • NDB API is a C++ record access API
      • supports sending parallel record operations within the same transaction or in different transactions
      • asynchronous and synchronous
      • NDB kernel is programmed entirely asynchronously
    • Looking at performance
      • Fire synchronous insert transactions – 10x TCP/IP time cost
      • Five inserts in one synchronous transaction – 2x TCP/IP time cost
      • Five asynchronous insert transactions – 2x TCP/IP
    • Read the rest of this article »

    0

    My MySQL Conference Schedule


    Posted by Artem Russakovskii on April 13th, 2008 in Databases, Programming

    Were there too many "my"'s in that title? Anyway… this week's MySQL conference is promising to be really busy and exciting. I can't wait to finally be there and experience it in all its glory. Thanks to the O'Reilly personal conference planner and scheduler and the advice of my fellow conference goers, I was able to easily (not really) pick out the speeches I am most interested in attending.

    Here goes (my pass doesn't include Monday šŸ™ ):

    Tuesday

    8:30am Tuesday, 04/15/2008

    State of MySQL

    Keynote Ballroom E

    MĆ„rten Mickos (MySQL)

    In his annual State of MySQL keynote, Marten discusses the current and future role of MySQL in the modern online world. The presentation also covers the …

    Read the rest of this article »

    49

    How To Add A File Extension To vim Syntax Highlighting


    Posted by Artem Russakovskii on April 2nd, 2008 in Databases, Linux, Programming

    Updated: July 8th, 2009

    Today I was asked a question about defining custom extensions for vim syntax highlighting such that, for example, vim would know that example.lmx is actually of type xml and apply xml syntax highlighting to it. I know vim already automatically does it not just based on extension but by looking for certain strings inside the text, like <?xml but what if my file doesn't have such strings?

    image

    After digging around I found the solution. Add the following to ~/.vimrc (the vim configuration file):

    1
    2
    3
    
    syntax on
    filetype on
    au BufNewFile,BufRead *.lmx set filetype=xml

    After applying it, my .lmx file is highlighted:

    image

    Same principle works, for instance, for mysql dumps …

    Read the rest of this article »

    11

    Getting The Most Out Of The MySQL Conference


    Posted by Artem Russakovskii on March 26th, 2008 in Databases, Personal

    As half of the world population already knows, the MySQL conference is coming in less than 3 weeks. Since this event only happens once a year, lasts only 4 days, and costs more than a Russian mail-order bride, I'd really like to get the most out of it. Considering that the schedule is completely packed, with 8 (!!) events going on in parallel, I imagine things can get a little frantic. Additionally, I've never been to a conference of such size before and I'm not sure what to expect.

    So… I'm contemplating:

    • printing out the event schedule and drawing a zig-zagging "map" of exactly where I'll be jumping to next, once the previous presentation ends. I'm actually wondering
    • Read the rest of this article »

    26

    Setting Up A MySQL Cluster


    Posted by Artem Russakovskii on March 26th, 2008 in Databases, Linux, Programming, Technology

    Updated: January 4th, 2009

    Attention: Apparently since the release of 5.1.25, cluster is packaged separately. I need to do some reading and research first and then update the tutorial with the latest info.

    Here are some quick links for now: http://blogs.mysql.com/kaj/2008/05/23/mysql-clusters-improved-release-model/, http://johanandersson.blogspot.com/2008/05/mysql-cluster-62-officially-released.html, http://blogs.sun.com/theaquarium/entry/improved_release_model_for_mysql.

    This article contains my notes and detailed instructions on setting up a MySQL cluster. After reading it, you should have a good understanding of what a MySQL cluster is capable of, how and why it works, and how to set one of these bad boys up. Note that I'm primarily a developer, with an interest in systems administration but I think that every developer should be able to understand and set up a MySQL cluster, at least to …

    Read the rest of this article »

    4

    MySQL Conference 2008


    Posted by Artem Russakovskii on March 24th, 2008 in Awesomeness, Databases, Linux, Personal, Programming, Technology

    Updated: March 26th, 2008

    April 14-17th is going to be an exciting time. Why? Because the 2008 MySQL Conference and Expo is going to be held in Santa Clara, CA. Who would want to miss out on a chance to lurk around, let alone talk to, some of the smartest people in the MySQL world? Well, those who don't have at least $1000+, of course. A 3 day pass to the conference without tutorials costs a whopping $1199. A full pass would dry up your pockets $1499.

    Well, "good news everyone". Thanks to Sheeri Cabral of The Pythian Group, PlanetMySQL.org, Jeremy, and, most importantly, LinuxQuestions.org, I am now in possession of a 3-day conference pass!! I'm incredibly excited that I …

    Read the rest of this article »

    0

    Must-Know People In The MySQL Field


    Posted by Artem Russakovskii on March 18th, 2008 in Databases, Programming

    Updated: June 24th, 2020

    If you're serious about MySQL, it doesn't hurt to know the people closely tied to its development and maintenance as well as famous bloggers. Here's my ongoing list of people I consider important:

    Peter Zaitsev – MySQL Performance Blog, former head of MySQL AB High Performance Group. His company Percona is available for consulting. He's a co-author of High Performance MySQL 2nd edition (great book).

    Baron Schwartz – also known as Xaprb, Baron a co-author of High Performance MySQL 2nd edition and creator of innotop and Maatkit. Maatkit is simply brilliant, and so is Baron. Baron recently joined Peter Zaitsev at Percona.

    Jeremy Zawodny – MySQL guru, works for Yahoo, and is considered a legend. He wrote mytop

    Read the rest of this article »

    0

    MySQL Falcon Storage Engine Enters Beta Stage.


    Posted by Artem Russakovskii on March 11th, 2008 in Databases, Linux, Programming

    Updated: March 18th, 2008

    Today Robin Schumacher, MySQL's Director of Product Management, announced that the mysql Falcon storage engine has moved into a beta release stage. Falcon, a new transactional storage engine introduced in mysql 6 (aka 5.2), has been in alpha for years. Other popular storage engines include MyISAM, InnoDB, which Falcon is supposed to challenge (successfully? :-/), and the upcoming Maria.

    Falcon features:

    • ACID transaction compliant
    • Crash recovery
    • User-defined tablespaces
    • High-speed data caches
    • Advanced B-Tree indexes
    • Performance/diagnostic monitoring tables
    • Simplified configuration

    You can download mysql 6 with Falcon here: http://dev.mysql.com/downloads/mysql/6.0.html….

    Read the rest of this article »

    0

    Sun buys MySQL for $1bln!


    Posted by Artem Russakovskii on January 16th, 2008 in Databases, Linux, Programming, Technology

    Updated: March 18th, 2008

    "Didn't see that one coming. Their blog contains details to what this could mean for both companies. May as well be one of the most important takeovers of 2008 already!"

    read more | digg story

    Could this mean that the mysql cluster is finally going to get proper development attention? I don't know but sure as hell hope so. Congratulations to all mysql employees!…

    Read the rest of this article »

    10

    sysbench – Linux Test Bench


    Posted by Artem Russakovskii on October 12th, 2007 in Databases, Linux

    Updated: October 22nd, 2011

    sysbench – Linux test bench. Easy as pie to test CPU, memory, threads, mysql, and disk performance.

    Full description is available here: http://sysbench.sourceforge.net/docs/

    install mysql, mysql-devel
    wget http://downloads.sourceforge.net/project/sysbench/sysbench/0.4.12/sysbench-0.4.12.tar.gz
    tar xvzf sysbench*gz
    cd sysbench*
    ./configure &#038;& make install

    mysql tests

    This will run 10 separate consecutive mysql tests using an InnoDB table type, each with 100 mysql threads, doing a total of 1000 various SQL operations per test. Then it will print the total time they took to finish:

    sysbench --test=oltp --mysql-user=USER --mysql-password=PASS --mysql-db=test \
      --mysql-host='HOST' --mysql-table-engine=innodb prepare
     
    time perl -e "foreach(1..10){print \`sysbench --max-requests=1000 --test=oltp \
      --mysql-user=USER --mysql-password=PASS 

    Read the rest of this article »