Entries Tagged as ‘SQL’

February 28, 2010

MySQL Triggers w/Rails

I recently incorporated db-triggers with a Rails app to maintain some counts that were otherwise fairly expensive to retrieve.  Rails wasn’t super-pumped about the idea (what with the “keep all the logic in the app” approach and all), but sometimes… you know… you know better than your framework. Some things I was aiming for: Set them [...]

March 2, 2007

Avoiding Insert Locking With Insert Into

Ran into an issue where shared locks were being applied (for InnoDB) on a statement with this format: insert into a select * from b; While that statement is running, not only does a have some locks applied, but so does b! problem is… my statement was not exactly that simple. Instead, the select statement [...]

July 18, 2006

The Future, Conan?

Why aren’t my fixtures properly loading their ‘registered’ timestamps correctly? Ah, the dreaded Year 2038 issue loads fine: user_registered: ’2038-01-18 21:14:07′ not happy: user_registered: ’2038-01-18 21:14:08′ So, that fixture that I just wanted to have ‘a date way out in the future’ will need to be knocked back a few years I guess.

April 19, 2006

Rubicizing

So far so good. In a fairly short amount of time I have an application with some basic functionality + user management (register, signin, email confirmations, etc). Very simple = very nice. So far I’ve been leaning pretty heavily on: Pick Axe – Especially Chapters 27 (Built-in Classes and Modules) & Chapter 28 (Standard Library). [...]

March 31, 2006

What Time(stamp) is it?

The app I am currently developing (in Java, not the Ruby tutorial I’ve been talking about) relies on a timestamp to report only the most recent activity to it’s clients. So, why was it not properly reporting our test data? After some deliberation I ran the simple statement: select distinct trim(current_timestamp) from xxx.yyy Why the [...]