All posts in 'English posts'

Optimizing the Oracle Query Optimizer

20-Oct-10

The Oracle Query Optimizer does a great job in rewriting Queries. For example the nested subquery in SELECT C.cust_last_name, C.country_id FROM customers C WHERE EXISTS (SELECT 1 FROM sales S WHERE S.quantity_sold > 1000 AND S.cust_id = C.cust_id);SELECT C.cust_last_name, C.country_id FROM customers C WHERE EXISTS (SELECT 1 FROM sales S WHERE S.quantity_sold > 1000 and […]

Read the complete article »

Unicode substrings in Ruby 1.8.x

15-Oct-10

Here is how to get correct unicode substrings in Ruby 1.8.x require ‘jcode’ $KCODE = ‘u’   "öäüÖÄÜß".split(//)[4,2].join # ÄÜrequire ‘jcode’ $KCODE = ‘u’ "öäüÖÄÜß".split(//)[4,2].join # ÄÜ Don’t know, if this performes well… In case you have better ideas, please drop me a comment.

Read the complete article »

Create reusable MySQL schema dumps

16-Sep-10

In case you need a MySQL schema transferred from one host to another and the schema names differ, you can ran into problems with a standard MySQL dump. Use the following statement to create a schema dump that contains all table and view definitions as well as all stored procedures without a reference to the […]

Read the complete article »

Oracle “sleep” procedure: DBMS_LOCK.SLEEP

07-Sep-10

There’s a nice little “sleep” procedure in Oracle: A procedure that stops the execution of the current thread for n seconds. Strangely, this method can be called in SQL*Plus like so: EXEC dbms_lock.sleep(10);exec dbms_lock.sleep(10); but not in another stored procedure or function like so CREATE OR REPLACE PROCEDURE FOOBAR AS BEGIN DBMS_LOCK.SLEEP(1); END; /CREATE OR […]

Read the complete article »

Preparing for Rails 2.3.9

06-Sep-10

As much as i wish to upgrade my Rails 2.3.x application Daily Fratze to the newest tag of the Rails 2.3.x branch, i cannot. First there was the epic fail of release 2.3.6, that broke all HTML Helpers and forced the Rails XSS protection upon us. This release was immediately followed by 2.3.7 and 2.3.8. […]

Read the complete article »