Showing entries 23071 to 23080 of 44965
« 10 Newer Entries | 10 Older Entries »
Multi-master replication

Implement multi-master to single-slave replication by periodically saving state and changing masters, and do it all in SQL.*

Just a proof of concept. I suggest you add some error checking (like, don't make the switch if the slave isn't running).

Remember that all this stuff goes on the SLAVE. If you absent-mindedly log in to the master, like I did a few times, you might wonder why your relay_log.info file isn't read.

Set up a table to keep track of each master file. Mine use the same user name and password for all hosts; you can add those fields and adjust the procedure accordingly if you like.

USE mysql;
DROP TABLE IF EXISTS rotate_master;
CREATE TABLE rotate_master (
id int auto_increment primary key,
master_host varchar(255),
master_port int unsigned,
master_log_file varchar(255),
master_log_pos int unsigned,
in_use boolean DEFAULT 0

[Read more]
Monitoring InnoDB Lock contention

When you use InnoDB, or any other RDBMS or storage engine that supports row level locking and transactions, you get to realize a few things:

  • The chance of lock contention is less, as the lock is much more granual that page or table level locking.
  • On the other hand, when you get into lock contention, maybe because you have structured your data in such a way so there may well be as many locks as before (for example if one small table with very few rows is updated frequently by many threads), then the effect is worse.
  • With transactions, which are a good thing by the way, I'm not promoting not transactions datastores here and assuming auto commit isn't used, then locks are held longer, and as each transaction may well hold several locks, because of multiple rows being updated or multiple statements are part of one transaction for example.
  • With InnoDB then, fining the root cause when you end up with …
[Read more]
distributed pushed down joins - progress and attitude

we're now at a stage so we can test/benchmark scan/scan queries, i.e push most queries. there are still know bugs and things that we can't push.

to see how we performs, we tested a very old query/dataset, that a customer tried in the 4.1 days. the result at that time was a disaster, and they at that time decided to use something else.

it's a 11-way join with mainly REF accesses (i.e not many lookups)

i tested it on same hardware/configuration as for my UC presentation.
without join pushdown the average query time is 3.6s.
with join pushdown it's ~500ms, i.e ~7x improvement.

the nights of kni are deeply disappointed, and that's an attitude i like :-)

FYI: we also optimized TPCW::getBestSeller …

[Read more]
OpenSQLCamp Boston seeking donations

-----------
If you are not familiar with OpenSQLCamp, here's a description from the home page at http://opensqlcamp.org/:

OpenSQL Camp is open to all – sessions have included PostgreSQL, SQLite, MySQL (and storage engines and forks thereof), Drizzle (and tools such as Google Proto Buffers), DBIx::Cache, Gearman, cloud computing, Unix tips, query optimization, Apache Derby, BlackRay, Continuent Tungsten, DB Clustering, Firebird, CouchDB, MongoDB, Cassandra, Firewater, how to version schemas, Waffle Grid / Storm Cloud, databases on SSDs, and even "soft" topics like the Open Database Alliance.

read more

How to do user language/locale detection quickly without Zend Framework

Recently I wrote about detecting the preferred language or locale of a web site visitor, using Zend Framework.

Well, I have to start with one correction. In my last blog post about this topic I talked about the User Agent String, but since I wrote the article, I figured out that the User Agent String doesn’t play any role at all. Neither in the Zend Framework variant that I blogged about earlier, nor in today’s code. And that is good so, because both Internet Explorer and …

[Read more]
20 latest unique records

From Stack Overflow:

I have a logfile which logs the insert/delete/updates from all kinds of tables.

I would like to get an overview of for example the last 20 people which records where updated, ordered by the last update (datetime DESC)

A common solution for such a task would be writing an aggregate query with ORDER BY and LIMIT:

SELECT  person, MAX(ts) AS last_update
FROM    logfile
GROUP BY
person
ORDER BY
last_update DESC
LIMIT 20

What's bad in this solution? Performance, as usual.

Since last_update is an aggregate, it cannot be indexed. And ORDER BY on unindexed fields results in our good old friend, filesort.

Note that even in this case the indexes can …

[Read more]
Using Pentaho Spoon to load data

Pentaho’s Spoon is an open source ETL or Extract, Transform and Load tool that makes loading data from various formats into a MySQL server easy. Spoon also lets you check the data for problems and correct them before it gets inserted. It does a lot of things very well to make life easier for a DBA. So if people are entering their state of residence as ‘CA’, ‘Cal’, ‘Cal.’ and ‘California’ , Spoon can clean up the data to what you need.

What follows is an example of transforming a CSV file into a series on INSERT statements. It is a very simple transformation but is a good initial exposure to how Spoon functions. It then covers how to use Spoon with a bulk loading program.

There have been questions on the Calpont InfiniDB forums (http://www.infinifb.org/forums) on using Spoon to drive the cpimport bulk loader program. LOAD DATA INFILE can be slow (10,000 …

[Read more]
451 CAOS Links 2010.08.24

The future of open source licensing. OpenSolaris governing board quits. And more.

Follow 451 CAOS Links live @caostheory on Twitter and Identi.ca
“Tracking the open source news wires, so you don’t have to.”

# Glyn Moody asked which open source software licensing is best for the future?

# The OpenSolaris Governing Board has collectively and expectedly resigned.

# OpenBravo has updated its rapid implementation ERP offering for small and mid-sized businesses, Openbravo QuickStart. …

[Read more]
SQLyog – MySQL GUI 8.6 GA – new features, improved performance and stability.

We are pleased to announce the release of SQLyog – MySQL GUI 8.6 GA. This release adds functionalities requested by users for some time, and fixes a number of bugs. Most important enhancements:

User management has been updated with a brand-new interface, has been completely rewritten and also now fully communicates with the MySQL server the recommended way using GRANT and REVOKE syntax. We believe that with this release we have provided the best available ever GUI for MySQL User Management.

For users that prefer to work in a spreadsheet-like interface when filtering and sorting data the options to do this have been enhanced: There is now a ‘custom filter’ option to be used when filtering on a value that does not exist in the result set displayed – or even is not stored in the table at all. Additionally you may now define the substring to be filtered on in more flexible …

[Read more]
Don’t forget to monitor your nameservers

As I mentioned in a past article I got my IPv6 connectivity working so started working on setting up various IPv6 services. One of these was to setup my name server so it also worked on IPv6. This worked fine, but recently I lost my IPv6 connectivity but thought no more about it. I’m trying [...]

Showing entries 23071 to 23080 of 44965
« 10 Newer Entries | 10 Older Entries »