IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 1 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New OK, here's a real bug, just encountered
Consider the following piece of SQL (against a stupid schema that someone else designed, natch):
\n            SELECT /* /dashboard/scorecard/ */\n                TO_CHAR(v.date_dm, 'YYYY-MM-DD') as "Week"\n              , v.visitors as "Unique Visitors"\n              , v.registered_visitors as "Registered Visitors"\n            FROM (\n                SELECT TRUNC(q.date_dm, 'DY') as date_dm\n                  , NVL(SUM(DECODE(q.type, 15, q.value, NULL)), 0)\n                    as visitors\n                  , NVL(SUM(DECODE(q.type, 16, q.value, NULL)), 0)\n                    as registered_visitors\n                FROM vw_ext_quickstats q\n                WHERE q.date_dm >= TRUNC(TO_DATE(:1, 'YYYYMMDD'), 'DY')\n                  AND q.date_dm <= TRUNC(TO_DATE(:2, 'YYYYMMDD'), 'DY')\n                  AND q.subtype = 1\n                GROUP BY TRUNC(q.date_dm, 'DY')\n              ) v\n

When I substitute in '20040404' and '20040504' in for :1 and :2 I get numbers for visitors and registered_visitors. When I execute the exact same SQL passing in parameters for placeholders, the date field is populated and everything else has 0s in it. I know that the parameters are actually being passed in properly because if they were wrong, then I wouldn't have all of the right dates in the output. (Plus I'm running the query through a well-tested piece of code, parameter passing darned well should work.)

I don't need help solving it, I already have a DBA working on the problem. Furthermore if it can't be fixed, then I'm sure I can find a workaround. (Heck, "substitute in actual values" is a decent workaround in this case - in fact it is what I'll probably do.) But I just wanted to give you a reality check demonstrating that I really do encounter bugs from time to time in 10G.

Cheers,
Ben
I have come to believe that idealism without discipline is a quick road to disaster, while discipline without idealism is pointless. -- Aaron Ward (my brother)
New I'll have to give that one a whirl.
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
New It can probably be simplified further...
And I don't know how general it is - just that it hit the database I was working against.

Cheers,
Ben
I have come to believe that idealism without discipline is a quick road to disaster, while discipline without idealism is pointless. -- Aaron Ward (my brother)
     subtracting dates inside rdbms as opposed to outside - (boxley) - (18)
         Indexes key to efficiency - (ChrisR) - (17)
             that runs faster by eyeball :-) thx! -NT - (boxley)
             Lotta people make that mistake. - (static)
             Indexes are only better if you're accessing under 7%... - (ben_tilly) - (14)
                 It's 5% now. - (admin) - (11)
                     Source? - (ben_tilly) - (10)
                         My SQL tuning class instructor. :-D -NT - (admin) - (9)
                             Is it coincidence that we both took that class recently? -NT - (ben_tilly) - (8)
                                 Dunno. - (admin) - (7)
                                     There was a cost-based optimizer in Oracle 8 as well - (ben_tilly) - (6)
                                         I'd appreciate a list if you can take the time. - (admin) - (5)
                                             Hmm... - (ben_tilly) - (4)
                                                 Thanks. -NT - (admin)
                                                 OK, here's a real bug, just encountered - (ben_tilly) - (2)
                                                     I'll have to give that one a whirl. -NT - (admin) - (1)
                                                         It can probably be simplified further... - (ben_tilly)
                 I heard 8% the other day for MySQL/InnoDB - (dws) - (1)
                     Percentage differences that close are really just a SWAG. - (broomberg)

I have this theory about the Brontosaurus...
39 ms