Doveriai, no proveriaiJune 7th, 2007 — ddelmoli
My friend Samir will appreciate the title on this. With apologies to Ronald Reagan and Mikhail Gorbachev.
I enjoyed this post by Jonathan Lewis, in which he discusses his reaction to a seemingly simple question on comp.databases.oracle.server. Basically, the question follows something which appears obvious:
I need to join the orders table to the order_lines table, does anyone have any ideas on what to do?
Almost anyone can answer this — do the join on the foreign key between the tables, use indexes and nested loops if the cardinality is low, hash or merge joins in the cardinality is high. And in many cases the happy database developer cheerfully writes the SQL and either puts it in a stored procedure for the Java girl to call or emails the query to the PHP guy who quickly embeds it in his page (the horror!).
My problem is that I don’t trust the question — it’s so simple, that there must be a reason why the person is asking it — surely not for the syntax. So, I don’t trust them — I start asking them why they want to know.
My son (he’s 7) loves to quote the following scene from the movie The Incredibles:
Lucius: “Honey? Where’s my super suit?”
Honey Best: “What?”
Lucius (exaggerated, drawn out): “Where… Is… My… Super… Suit?”
Honey Best (also exaggerated): “Why… Do… You… Need… To… Know?”
Lucius (angry): “You tell me where my suit is, woman! We’re talking about the greater good!”
Honey Best (riposte): “I’m your wife, Lucius! I’m the greatest good you’re ever gonna get!”
Honey Best’s lines are classic — I’m not giving you the easy answer, I need to know what you’re going to do with it. And even then, I’ll reserve the right not to tell you if I don’t trust what you’re going to do.