[FUN] How to tune select count(*) from t?

A user mentioned one call is faster in test than in prod. And the table has the same size. How could we tune the production to make it quick? user007@PROD> select count(*) from t; COUNT(*) ———- 19832501 Elapsed: 00:03:05.00 Let’s try in test : user007@TEST> select count(*) from t select count(*) from t * ERROR […]

to SQL or to PLSQL

Iggy Fernandez posted a riddle to be solved without PLSQL http://www.amazon.com/gp/blog/post/PLNKI2MYB0YCYAUL I tend to second Steven Feuerstein argument : Some people can perform seeming miracles with straight SQL, but the statements can end up looking like pretzels created by someone who is experimenting with hallucinogens. In my book I mentionned techniques that enhance the basis […]

high cost

What’s wrong with this query ? select (t6.column_value).getstringval() t6 from table(xmlsequence(extract(xmltype(‘<x/>’),’/x’))) t1, table(xmlsequence(t1.column_value))t2, table(xmlsequence(t2.column_value))t3, table(xmlsequence(t3.column_value))t4, table(xmlsequence(t4.column_value))t5, table(xmlsequence(t5.column_value))t6; T6 ———————— <x/> Elapsed: 00:00:00.01 Well, let’s check the plan : ——————————————————————– | Id | Operation | Rows | Bytes | Cost (%CPU)| Time | ——————————————————————– | 0 | SELECT STATEMENT | 18E| 15E| 18E (0)|999:59:59 | | […]

Are you really 18 years old today?

18 is a nice age here. You can vote, you can watch movie or drink Gin-tonic. You also get married and go to jail ! Are you really 18 today? select add_months(date ‘1990-02-28’,18*12) from dual; ADD_MONTHS(DATE’199 ——————- 29.02.2008 00:00:00 come back tomorrow 😈 or check an old post of mine How old are you 😀