Today I read

A notebook of things I read and notes to remember the content better. Expect no coherent shape.

https://www.youtube.com/watch?v=IyNPeTn8fpo - Scrum et al. Ken Schwaber

High Performance MySQL - Baron Schwartz, Peter Zaitsev, and Vadim Tkachenko. 3rd edition.

MySQL accepts X.509 in auth, which is governed by hierarchical CAs, much different to PGP's web of trust.

Query cache can store only SELECT statements, along with their result sets. ... the server doesn’t need to parse, optimize, or execute the query at all, it can simply pass back the stored result set. (:fa-question: How does invalidation work?)

shared locks and exclusive locks, or read locks and write locks. Read locks on a resource are shared, or mutually nonblocking: many clients can read from a resource at the same time. Write locks, on the other hand, are exclusive—i.e., they block both read locks and other write locks.

Percona XtraDB is a storage engine for the MariaDB and Percona Server databases, and is intended as a drop-in replacement to InnoDB, which is one of the default engines available on the MySQL database. XtraDB incorporates InnoDB's ACID-compliant design and MVCC architecture, and allows for a greater degree of tuning and scalability. The engine is also better suited to multi-core processing, which addresses some of the issues known to InnoDB

Transactions aren’t enough unless the system passes the ACID test. ACID stands for Atomicity, Consistency, Isolation, and Durability.

Reading uncommitted data is also known as a dirty read.

phantom read can happen when you select some range of rows, another transaction inserts a new row into the range, and then you select the same range again;

The way InnoDB currently handles deadlocks is to roll back the transaction that has the fewest exclusive row locks (an approximate metric for which will be the easiest to roll back).

multiversion concurrency control (MVCC), there is no standard for how MVCC should work. You can think of MVCC as a twist on row-level locking; it avoids the need for locking at all in many cases and can have much lower overhead. Depending on how it is implemented, it can allow nonlocking reads, while locking only the necessary rows during write operations.

In InnoDB, primary key column is part of secondary indexes so they grow large if primary is large - clustered index.

InnoDB, unlike other storage engines, supports hot backup - Oracle’s proprietary MySQL Enterprise Backup and the open source Percona XtraBackup. MySQL’s other storage engines can’t take hot backups—to get a consistent backup, you have to halt all writes to the table, which in a mixed read/write workload usually ends up halting reads too.

ballpark figure, guesstimate, an educated guess or estimation within acceptable bounds.

MySQL supports manual and automatic checking and repairing of MyISAM tables, but don’t confuse this with transactions or crash recovery. After repairing a table, you’ll likely find that some data is simply gone.

FederatedX, sotrage engine that allows connecting to other systems rather than stroing data.

TokuDB uses a new index data structure called Fractal Trees, which are cache-oblivious, so they don’t slow down as they get larger than memory, nor do they age or fragment.

RethinkDB, ~~Falcon~~, The NDB Cluster engine, The Merge storage engine, The Memory engine, The CSV engine, The Blackhole engine, Infobright (column storage).

Some good GIS in MySQL 5.7

Cracking the Coding Interview: 189 Programming Questions and Solutions

It is very possible for O(N) code to run faster than 0(1) code for specific inputs. Big 0 just describes the rate of increase.

Amortized Time

The Algorithm Design Manual - Steven Skiena

Chapter 2

RAM model:

Function names:

... is of greater order than ...

n! ≫ 2ⁿ ≫ n³ ≫ n² ≫ n log n ≫ n ≫ log n ≫ 1

O(f(n)) + O(g(n)) → O(max(f(n), g(n))) - sum of two functions is governed by the dominant one

:fa-exclamation-triangle: f(n) = O(n²), g(n) = O(n²), f(n) + g(n) = O(n²), not very intuitive

Logarithms arise in any process where things are repeatedly halved.

How many bits do we need to store 256 values? 8!

math.log2(256) 8.0

binary logarithm, natural log, common logarithm (base 10)

Why is log base ignored in Big Oh?

The base of the logarithm has no real impact on the growth rate- Compare the following three values: log 2 (1, 000, 000) = 19.9316, log 3 (1, 000, 000) = 12.5754, and log 100 (1, 000, 000) = 3. A big change in the base of the logarithm produces little difference in the value of the log. Changing the base of the log from a to c involves dividing by log c a. This conversion factor is lost to the Big Oh notation whenever a and c are constants. Thus we are usually justified in ignoring the base of the logarithm when analyzing algorithms.

Chapter 1

abc: a, b, c, ab, ac, bc, abc, ∅

abcd:a, b, c, d, ab, ac, ad, bc, bd, cd, abc, abd, acd, bcd, abcd, ∅

Naked warrior

How lifters really train?

Performing more than 6 reps per set hinders strength development

iron cross

2016-11-22

Understanding Python metaclasses

2016-11-21

Python Design Patterns: For Sleek And Fashionable Code

2016-11-18

How to select the first/last/max row per group in SQL

December

Tribes. We need you to lead us

The Power of Habit: Why We Do What We Do in Life and Business

The Pragmatic Programmer: From Journeyman to Master

September

Cargo cult programming


bartekbrak1@gmail.com