May 26, 2012

Post: Statement based replication with Stored Functions, Triggers and Events

… is the behavior of the MySQL when it needs to log “not usual” queries like Events, Functions, Stored Procedures, Local Variables, etc. We… behavior can be a problem to take in account or in some other cases help us in our infrastructure. Is possible to define… t VALUES(this_year())’ STORED PROCEDURES The behaviour of stored procedures and functions are completely different. If our stored procedure write data to our…

Post: A micro-benchmark of stored routines in MySQL

… wondered how fast stored routines are in MySQL? I just ran a quick micro-benchmark to compare the speed of a stored function against a… took the subquery and basically rewrote it as a stored function. mysql> delimiter // mysql> create function speaks_english(c char(3)) returns integer deterministic > begin…

Post: UDF -vs- MySQL Stored Function

… it to sphinx – MySQL did not have a function to do the thing so I thought I’ll write MySQL Stored Function and we’ll… | +———-+ 1 row in set (11.19 sec) Whereas using stored function used to take minutes! I don’t mean to say stored functions are bad and you should now rewrite all your functions

Post: Memory allocation in Stored Function

… see MySQL ate 5GB of memory in 85 sec. That makes things clearer. As I understand MySQL allocates memory in each call of Stored Function, but de-allocates it only at the end of statement. This makes usage of Stored Function

Post: Stored Function to generate Sequences

… to convert their sequence generation process to the stored procedure and even though I have already seen… using this function allows you to “inject” the value to be returned next time this function is called…. even pure sequential value as in the case above can be quite helpful – in MySQL 5.0 you may…

Post: When should you store serialized objects in the database?

… blog post explaining how they changed from storing data in MySQL columns to serializing data and just storing it inside TEXT/BLOB columns. It… clear loss in functionality. You can no longer easily perform aggregation functions on the data (MIN, MAX, AVG). You are storing the data in a…

Post: Database problems in MySQL/PHP Applications

… not expect it to beat MySQLi in speed. It is however bad idea to use mysql_ functions directly as well – I would go… DVD Store optimization, and I’m now on my own, offering MySQL and LAMP Consuilting Services. 2. Not using auto_increment functionality This… hand in MySQL you might be better of using several queries than doing complicated ones. Of course you would rather use IN() than…

Post: Watch out for your CRON jobs

function in MySQL. The second one is good if you want to serialize jobs from multiple servers (for example you specially put script in… should find you. Store Historical Run Times In a lot of cases when CRON job can’t complete in time any more I… time gradually until it could not complete in time. Create the table in the database and store information about how long cron took…

Post: Withdrawal of Memory allocation in Stored Function

Returning to my post about memory consumption with Stored Function at this moment I want to annul that post. Trying … probably there was something wrong with the whole box, not MySQL. I apologize if it was confusing. Although I am almost…

Post: MySQL opening .frm even when table is in table definition cache

… the above strace shows. In MySQL 5.5 you can find in sql/datadict.cc a function named dd_frm_type(). In MySQL 5.1, for some reason yet unknown to humans, it lives in… of the FRM file. This is due to VIEWs being stored as the plain text of the SQL query inside the…