Archive for May 2013

Installing the DBT2 Benchmark Tool on Linux

Just recording the process I used to install the DBT2 bench-marking tool. I used OpenSuSE 12.1 for this but should work on many distributions. ?View Code BASHcd /opt/src wget http://downloads.mysql.com/source/dbt2-0.37.50.3.tar.gz tar xvf dbt2-0.37.50.3.tar.gz cd dbt2-0.37.50.3/ ./configure –with-mysql make make install Don’t forget to read the documentaiton to start running MySQL benchmarks… cat README-MYSQL

Functions & sargable queries

Using functions improperly in your where clauses always prevents index usage right? I’ve been reviewing some queries generated by linq and I’ve found out this isn’t always the case. A quick demo… Create a temp tables and insert some data ?View Code TSQLCREATE TABLE #test ( id INTEGER NOT NULL PRIMARY KEY CLUSTERED, [name] VARCHAR(100) NOT NULL ); […]

[ERROR] Native table ‘performance_schema’.’table name’ has the wrong structure

After I upgraded an instance to MySQL 5.7 I noted the following errors in the log; 2013-05-23 11:40:24 30199 [ERROR] Native table ‘performance_schema’.’events_statements_current’ has the wrong structure 2013-05-23 11:40:24 30199 [ERROR] Native table ‘performance_schema’.’events_statements_history’ has the wrong structure 2013-05-23 11:40:24 30199 [ERROR] Native table ‘performance_schema’.’events_statements_history_long’ has the wrong structure 2013-05-23 11:40:24 30199 [ERROR] Native table ‘performance_schema’.’events_statements_summary_by_thread_by_event_name’ […]

Are you checking for possible integer overflow?

I realized I wasn’t! We run a couple of systems that I know stick a mass of records through on a daily basis. Better start doing this then or I might end up doing a whoopsie! Here’s a script I’ve quickly knocked up to make checking this simple. This script will check the specified tables TINYINT, SMALLINT, INT & BIGINT values […]