|Showing entries 1 to 30 of 39||Next 9 Older Entries|
One of the most common errors in development is where a loop or a retrieval by index falls short or long by one unit, usually because of an oversight or a logic in coding.
Of the following snippets, which one will run 10 times?
/* #1 */ for (N = 0 ; N < 10; N++) printf("%d\n", N);
/* #2 */ for (N = 0 ; N <= 10; N++) printf("%d\n", N);
/* #3 */ for (N = 1 ; N <= 10; N++) printf("%d\n", N);
/* #4 */ for (N = 1 ; N < 10; N++) printf("%d\n", N);
The question is deceptive, as there are two snippets that will run 10 times (1 and 3). But they will print different numbers. If you ware aiming for numbers from 1 to 10, only #3 is good.
After many years of programming, off-by-one errors are rare in my code, and I have been able to spot[Read more...]
New GUI, 30+ New Features, and Major New Components
Oracle is excited to announce the immediate availability of the production-read, GA release of MySQL Workbench 6.0, available for download under the GPL, as well as part of the Commercial MySQL Standard, Enterprise, and Cluster Carrier Grade Editions with 24x7 global support.
The need by database professionals for management tools has increased with expanding data volumes, web, cloud and mobile computing growth. Improvement and additions in MySQL Workbench helps developers and administrators better manage these dynamic data environments. This latest GA release includes many new features and a modernized user interface that allows users to simplify MySQL database development, design and administration.
The goal of MySQL Workbench 6.0 is to simplify and improve the workflow in the
Often application needs to know where a user is physically located. The easiest way to figure that out is by looking up their IP address in a special database. It can all be implemented in MySQL, but I often see it done inefficiently. In my post I will show how to implement a complete solution that offers great performance.Importing Geo IP data
First you will require a database mapping network addresses to real locations. There are various resources available, but I chose the one nginx web server uses with its geoip module. GeoLite City comes in CSV format and is available for download with no charge from MaxMind.
The archive contains two files. GeoLiteCity-Blocks.csv lists all IP[Read more...]
Often I see a SQL problem solved incorrectly and I do not mean inefficiently. Simply incorrectly. In many cases the developer remains unaware that they aren’t getting the results they were expecting or even if a result is correct, it is only by chance, for example because the database engine was smart enough to figure out some non-sense in a query. In a few posts I will try to disclose some of the more common problems.Aggregate with GROUP BY
Unlike many other database systems, MySQL actually permits that an aggregate query returns columns not used in the aggregation (i.e. not listed in GROUP BY clause). It could be considered as flexibility, but in practice this can easily lead to mistakes if a person that designs queries does not understand how they will be executed. For example, what values an aggregate query returns for a[Read more...]
tldr; A single MySQL Cluster prioritises Consistency in Network partition events. Asynchronously replicating MySQL Clusters prioritise Availability in Network partition events.
"Shard-Query is a distributed parallel query engine for MySQL"
"ShardQuery is a PHP class which is intended to make working with a partitioned dataset easier"
"ParallelPipelining - MPP distributed query engines runs fragments of queries in parallel, combining the results at the end. Like map/reduce except it speaks SQL[Read more...]
tl;dr : New 'automatic' optimistic conflict detection functions available giving the best of both optimistic and pessimistic replication on the same data
The Open Query GRAPH engine (OQGRAPH) is a computation engine allowing hierarchies and more complex graph structures to be handled in a relational fashion. In a nutshell, tree structures and friend-of-a-friend style searches can now be done using standard SQL syntax, and results joined onto other tables.
My wife – a good web designer with 6 years of experience with web design, HTML and CSS is looking for a job. Here is some information about her:
We’re physically located in Toronto, Canada, but she has a great experience of working remotely too. So, if you need a web designer or a junior web designer, feel free to contact Tanya.[Read more...]
It may seem hard to believe, but I have seen DECIMAL(31,0) in action on a production server. Not just in one column, but in 15 columns just in the largest 4 tables of one schema. The column was being used to represent a integer primary or foreign key column.
In a representative production instance (one of a dozen plus distributed production database servers) the overall database footprint was decreased from ~10 GB to ~2 GB, a 78% saving. In total, 15 columns across just 4 tables were changed from DECIMAL(31,0) to INT UNSIGNED.
One single table > 5GB was reduced to under 1GB (a 81% saving). This being my record for any GB+ tables in my time working with the MySQL database.
Had this server for example had 4GB of RAM, and say 2.5GB allocated to the innodb_buffer_pool_size, this one change moved the system from requiring more consistent disk access (4x[Read more...]
|Showing entries 1 to 30 of 39||Next 9 Older Entries|