May 25, 2012

Post: Neat tricks for the MySQL command-line pager

How many of you use the mysql command-line client?  And did you know about the pager command you can give it?Â… at the command line in the traditional Unix pipe-and-filter manner. What sort of goodies can we think of here? mysql> pager mk-visual-explain PAGER set to ‘mk-visual-explain’ mysql> explain select * from sakila.film inner…

Post: MySQL 5.1 Command line client improvements

Just found this little handy feature today: mysql> insert into c select rand()*1000, sha1(rand()) from c; Query aborted by Ctrl… execution was interrupted So now if you press CTRL-C MySQL Command Line Client will not exit but will terminate query being executed… assumed CTRL-C would also abort running query in previous MySQL versions and I’ve seen many monstrous queries left running…

Post: MySQL Query Cache WhiteSpace and comments

… this as command line client is known to optimize queries sometimes by skipping “unnecessary” comments. So here is the command line run: mysql> select /* my little… | 4 | Sending data | select count(*) from fact where val like “%c%” This tells us we should not use MySQL Command Line Client for any tests involving comments Repeating queries from PHP instead we can learn the following about MySQL 5…

Post: Shard-Query turbo charges Infobright community edition (ICE)

… there are only 29 air carriers in the table: mysql> select count(*), count(distinct UniqueCarrier) from dim_flightG *************************** 1. row …the underlying storage for the virtual machines. Baseline: The MySQL command line client was used to execute the a script file…

Post: Can we improve MySQL variable handling ?

… way I’m aware about is running the server from command line with –no-defaults –verbose –help options: pz@ubuntu:~$ /usr/sbin… to read it: mysql> set global sort_buffer_size=DEFAULT; Query OK, 0 rows affected (0.00 sec) mysql> select @@global.sort_buffer… good idea to extend SELECT syntax to ease querying of variable global value Right now I can select: mysql> select @@global.sort_buffer_size…

Post: Flexviews - part 3 - improving query performance using materialized views

…the command line: $ cat sales.sql create table dashboard_customer_sales AS selectmysql> select sum(total_lines) from dashboard_customer_sales ; +——————+ | sum(total_lines) | +——————+ | 155186550 | +——————+ 1 row in set (0.64 sec) mysql> select sum(total_lines

Post: How fast is FLUSH TABLES WITH READ LOCK?

… | Command | Time | State | Info | +—-+——+———–+——+————+——+——————-+———————————————————————-+ | 4 | root | localhost | test | Query | 80 | Sending data | select…because it was a MySQL command-line client that wasn’t …

Post: Talking MySQL to Sphinx

…@r27 sp]# mysql –host 127.0.0.1 –port 3307 Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id… select max(author_id) as a ,forum_id as f from sptest where num_links=1; Empty set (2.70 sec) MySQL mysql> select… using Native API more feature full at this point but command line language is very helpful for testing and debugging purposes as…

Comment: MySQL Query Cache WhiteSpace and comments

… the mysql command line client now has an *option* to pass comments to the server, but it’s disabled by default: http://bugs.mysql.com/bug.php?id=26215 I’m running the 5.0.56 client and server, and from the command line, my…: 2 Lock_time: 0 Rows_sent: 230400 Rows_examined: 480 select /* my comment */ * from test.WEBSITE a, test.WEBSITE b;

Post: How Percona diagnoses MySQL server stalls

…will be. Find and change the following lines: # This is the max number of Select a timestamp from the list: 2011_… ‘?’ key for a list of the keystroke commands you can use. If you find … things that can cause a stall in MySQL, and they usually begin microscopically and …