June 19, 2013

Post: SQL Injection Questions Followup

… SQL in your Stored Procedures you have other issues :)   I consulted for a customer who uses dynamic SQL in stored procedures extensively.  They found that it was awkward because of the limits of the procedure language MySQL offers, and also…

Post: Filtered MySQL Replication

… not a big fan of filtered or partial MySQL Replication (as of version MySQL 5.0) – there is enough gotchas with replication… them. For example stored procedures are handled (because binary logging is done on statements as executed inside stored procedures), however Stored Functions are not – so…

Post: MySQL Slow query log in the table

As of MySQL 5.1 get MySQL slow query log logged in mysql.slow_log table instead of the file as you had… lazy typing it over and over again you can create stored procedure, something like LAST_SLOW_QUERIES and use it instead, just…. One thing which would be rather handy is UDF or stored procedure to “normalize” query by removing comments and replacing constants with…

Post: MySQL Query Cache

… great feature called “Query Cache” which is quite helpful for MySQL Performance optimization tasks but there are number of things you… SELECT queries are cached SHOW commands or stored procedure calls are not, even if stored procedure would simply preform select to retrieve data from…

Post: MySQL Server Memory Usage

…to be impractical. Here is why: List of rarely considered MySQL Server Memory Requirements Thread buffers can be allocated more …memory requrement for this step, especially specially crafted ones. Stored Procedures. Compex stored procedures may require a lot of memory Prepared statements and Cursors…

Post: Announcing Percona Server 5.1.66-14.2

… available here and from the Percona Software Repositories). Based on MySQL 5.1.66, including all the bug fixes in it… case of individual statements in stored procedures correctly, this caused Query_time to increase for every query stored procedure logged to the slow query…

Comment: MySQL Stored Procedures problems and use practices

I had very bad experience with mysql stored procedure and triggers. I think mysql should provide a tool for stored procedure programming with debug facility.

Post: Stored Function to generate Sequences

…help them to convert their sequence generation process to the stored procedure and even though I have already seen it somewhere I…for one or more sequences, which also can be helpful: mysql> select seq(‘one’),seq(‘two’),seq(‘one’),seq(‘one’); +————+————+————+————+ | …

Post: How fast can MySQL Process Data

… with just 10000 rows and wrote little stored procedure to make timing easier: mysql> DELIMITER // mysql> CREATE PROCEDURE test_read(pl INT) -> BEGIN -> DECLARE t…; -> END; -> // Query OK, 0 rows affected (0.00 sec) mysql> DELIMITER ; mysql> call test_read(1000); Query OK, 0 rows affected (1…

Post: PHP Large result sets and summary tables.

… of swap space) like crazy. Why ? Because by default mysql_query uses mysql_store_result C library call and buffers all result set… similar behavior. This call users underlying mysql_use_result API call which does not store all result set in memory but instead… much more efficient. Another alternative is of course to use MySQL Stored Procedures which can be fit to do this simple job. The…