Home |  MySQL Buzz |  FAQ |  Feeds |  Submit your blog feed |  Feedback |  Archive |  Aggregate feed RSS 2.0 English Deutsch Español Français Italiano 日本語 Русский Português 中文
Showing entries 1 to 13

Displaying posts with tag: refactoring (reset)

Re-factoring some internals of prepared statements in 5.7
Employee +1 Vote Up -0Vote Down
[ this is a re-posting of what I published on the MySQL server team blog a few days ago ]
 
When the MySQL server receives a SELECT query, the query goes through several consecutive phases:
  • parsing: SQL words are recognized, the query is split into different parts following the SQL grammar rules: a list of selected expressions, a list of tables to read, a WHERE condition, …
  • resolution: the output of the parsing stage contains names of columns and names of tables. Resolution is about making sense out of this. For example, in “WHERE foo=3“, “foo” is a column name without a table name; by applying SQL name resolution rules, we discover the table who contains



  [Read more...]
Poor programming practices
+3 Vote Up -2Vote Down

When will it stop. These amateur programmers that simply cut/paste code really affect those good programmers in the ecosystem trying to make a decent living. I was reviewing a developed (but incomplete) PHP/MySQL system using a common framework (which in itself is irrelevant for this post).

In one source file there were 12 repetitions of the following code:

   //permissions
    $this->security_model->setUserPermissions($id);
    if (!array_key_exists($id,$this->session->userdata['permissions']) OR
	!array_key_exists('id', $this->session->userdata['permissions'][$id]) OR
	!array_key_exists('scope', $this->session->userdata['permissions'][$id]['name'])){
      $this->session->set_flashdata('alert', 'You are not authorized to go there.');
      redirect($this->agent->referrer());
    }

It’s bad enough when code

  [Read more...]
Getting rid of huge ibdata file, no dump required, part II
+1 Vote Up -1Vote Down

This post continues Getting rid of huge ibdata file, no dump required, part I, where I describe way of converting your single-tablespace InnoDB database into a file-per-table one, without the pain of exporting and importing everything at once.

In previous part we put aside the issue of foreign keys. We address this issue now.

What if my InnoDB tables have foreign keys?

MyISAM does not support them, so you can't just ALTER an InnoDB table to MyISAM and back into InnoDB, and expect everything to work.

Alas, this calls for additional steps (i.e. additional ALTER commands). However, these still fall well under the concept of "do it one table at a time, then take time to recover your breath

  [Read more...]
Getting rid of huge ibdata file, no dump required
+4 Vote Up -1Vote Down

You have been told (guilty as charged), that the only way to get rid of the huge InnoDB tablespace file (commonly named ibdata1), when moving to innodb_file_per_table, is to do a logical dump of your data, completely erase everything, then import the dump.

To quickly reiterate, you can only delete the ibdata1 file when no InnoDB tables exist. Delete this file with an existing InnoDB table, even a table in its own tablespace, and nothing ever works anymore.

The problem with the dump-based solution

The impact of doing a logical dump is often overwhelming. Well, the dump may be tolerable, but the restore is

  [Read more...]
Resilient Services – Resilient Infrastructure – Site Reliability Engineer
+0 Vote Up -0Vote Down

Modern internet infrastructure are complex.  Components and services are prone to failure.  Resiliency involves building redundancy, best practices and processes into your architecture to make you able to bend and not break.

  • Migrating to cloud service providers
  • Rearchitecting and refactoring applications to scale
  • Scaling the database tier - MySQL and Oracle
  • Building redundancy into every layer
  • Deploying object caches - memcache
  • Deploying page caches - varnish
  • Migrating to Innodb - transactional storage engine
  • Infrastructure design
  • Infrastructure automation
  • Disaster Recovery
  • Business Continuity with cloud deployments

Call or Skype us in New York City +1-212-533-6828

MySQL - the best stored routine is the one you don't write
+5 Vote Up -0Vote Down
At Fosdem 2010, already two weeks ago, I had the pleasure of hearing Geert van der Kelen explain the work he has been doing on connecting MySQL (http://www.mysql.com/" target="mysql) and Python. I don't know anything about Python, but anybody that has the courage, perseverance and coding skills to create an implementation of the the MySQL wire protocol from scratch is a class-A programmer in my book. So, I encourage everyone that needs MySQL connectivity for Python programs to check out Geert's brainchild, MySQL Connector/Python.

In relation to MySQL Connector/Python, I just read

  [Read more...]
MySQL: Refactoring a Stored Function
+6 Vote Up -0Vote Down
Hi All!

I was just reading PlanetMySQL and noticed Mike Hillyer's recent post on a user-friendly age function for MySQL. Basically, this function accepts two DATETIME values and returns an indication of the time between the two dates in the form of a human-readable string. For example:
mysql> select  TimeDiffUnits('2001-05-01', '2002-01-01')
+-------------------------------------------+
| TimeDiffUnits('2001-05-01', '2002-01-01') |
+-------------------------------------------+
| 8 Months |
+-------------------------------------------+
1 row in set (0.00 sec)


Just









  [Read more...]
MySQL reengineering project
Employee +4 Vote Up -1Vote Down

Here's another chapter of the MySQL evolution saga.

We know that MySQL today, although hugely popular and effective, has many shortcomings. A Refactoring effort has been announced, after a few months of internal discussions.

The effort is open to external contributions. There is a mailing list for discussing the "what" and the "how" of the new path.

The goals of the project are basically

  • Modularity. Make it easier to add new features without breaking existing ones.
  • Pluggability. Make it easier for third parties to add functionality.
  • Maintainability. Make it easier to fix bugs and test, by way of

  [Read more...]
MySQL reengineering project
Employee +0 Vote Up -0Vote Down

Here's another chapter of the MySQL evolution saga.

We know that MySQL today, although hugely popular and effective, has many shortcomings. A Refactoring effort has been announced, after a few months of internal discussions.

The effort is open to external contributions. There is a mailing list for discussing the "what" and the "how" of the new path.

The goals of the project are basically

  • Modularity. Make it easier to add new features without breaking existing ones.
  • Pluggability. Make it easier for third parties to add functionality.
  • Maintainability. Make it easier to fix bugs and test, by way of

  [Read more...]
MySQL reengineering project
Employee +0 Vote Up -0Vote Down

Here's another chapter of the MySQL evolution saga.

We know that MySQL today, although hugely popular and effective, has many shortcomings. A Refactoring effort has been announced, after a few months of internal discussions.

The effort is open to external contributions. There is a mailing list for discussing the "what" and the "how" of the new path.

The goals of the project are basically

  • Modularity. Make it easier to add new features without breaking existing ones.
  • Pluggability. Make it easier for third parties to add functionality.
  • Maintainability. Make it easier to fix bugs and test, by way

  [Read more...]
A Faster MySQL Database Size Google Chart
+0 Vote Up -0Vote Down
Abstract - As described by Walter Heck, MySQL database size can be visualized using Google Charts. With a minor code improvement the URL for the chart can be obtained twice as fast. With some more modification, the number of lines can be cut down resulting in a function that is half as long.

Hi!

It's been a while since I posted - I admit I'm struggling for a bit to balance time and attention to the day job, writing a book, preparing my talks for the MySQL user's conference and of

  [Read more...]
Refactoring MySQL Applications: Part 1
+0 Vote Up -0Vote Down

First off, let me wish you all a Happy 2009, and my apologies for being a bit slack with blogging in the last two months of 2008. It’s been a bunch of busy weeks, but I’m fully expecting to remedy that in this year.

Second, let me welcome you to this series on refactoring MySQL applications. I will cover best practices and useful tips, as well as show working examples of potential loopholes and solutions.

So, you are a DBA or a developer, and you’re faced with a problem. Your years-old application (perhaps you inherited it from a former co-worker) is now starting to keel over, and your choice of responses is limited.

Let’s start by saying that there are other ways to reach performance, but in some cases refactoring may be the only way that is possible to pursue, for one reason or another. Let’s take the refactoring way, focusing on SQL

  [Read more...]
Thoughts and MaxDB and MySQL
+0 Vote Up -0Vote Down
Do note: This is my personal blog, and all thoughts expressed here are my own, and are not necessarily shared by my employer.

So... I was talking with my cohort, Ulf about the future of MySQL and MaxDB.

He got me thinking about what the relationship between MySQL and SAP/MaxDB really is. What does the "partnership" mean a few levels below the VP?

To me, it means that, going forward, I expect to see a lot of communication and camaraderie between the MySQL and MaxDB developers. I expect to see a lot of MaxDB's rock solid, tried and true code become shared libraries which are then linked against by MySQL. I expect to see a lot of MySQL's tools that provide the usability and simplicity that the community has come to expect from them generalized in such a way that they can be used to administer a MaxDB system. I expect to see MaxDB adopt





  [Read more...]
Showing entries 1 to 13

Planet MySQL © 1995, 2014, Oracle Corporation and/or its affiliates   Legal Policies | Your Privacy Rights | Terms of Use

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.