(Rob Gravelle) As promised in the MySQL Cursors and Loops article, this article explores the use of cursors and their role in stored procedure programming. A cursor is a special kind of loop for traversing through an SQL resultset one row at a time. That allows us to perform operations on every reco
Tag: Open Source
How to safely change the ‘postgres’ user password via ‘psql’
(Gabriele Bartolini) One of the most recurring questions I get from users that are starting their long and prosperous journey with PostgreSQL involves connecting with the “postgres” user.
MySQL Subquery Optimization
(Sean Hull) MySQL’s optimizer can do a lot of things, but subqueries are not always handled well. Take a look at the IN subquery below. If you see the DEPENDENT SUBQUERY in your explain plan, you may want to take a second look. This will run slow as a dog, when the tables get large.
PostgreSQL Statistics: pg_statistic and pg_stat(io)_*
(Amit Langote) We hear about two kinds of statistics in PostgreSQL:
A new big data structure for streaming counters – bit length encoding
(Justin Swanhart) One of the challenges of big data is that it is, well, big. Computers are optimized for math on 64 bits or less. Any bigger, and extra steps have to be taken to work with the data which is very expensive. This is why a BIGINT is 64 bits. In MySQL DECIMAL can store more than 64 bit
Tips for working with append-only databases using sharding and log structured tables
(Justin Swanhart) This post is structured like a series of questions and answers in a conversation. I recently had a number of conversations that all pretty much went this same way. If you, like others, have many basic questions about how to proceed when faced with an append-only store for the fir
3 Ways to Optimize for Paging in MySQL
(Sean Hull) Lots and lots of web applications need to page through information. From customer records, to the albums in your itunes collection. So as web developers and architects, it’s important that we do all this efficiently.
Debugging obscure Postgres problems with strace
(Greg Sabino Mullane) One of the nice things about being a Postgres consultant is the sheer variety of interesting problems you get to solve. Here’s one that recently popped up, and a walkthrough of how I solved it.
Deciding whether or not to make MySQL durable
(morgan tocker) Today I had intended to talk about my approach and thought process in configuring a fresh MySQL server running 5.6 with the InnoDB storage engine. However, it didn’t quite work out that way. I managed to get side-tracked by decision #0 – whether or not durability is important.
Closing the Unique Index Null Loophole
(Ike Walker) As documented in the MySQL Reference Manual: a UNIQUE index permits multiple NULL values for columns that can contain NULL.
