----- Original Message ----- From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Thursday, September 26, 2002 2:15 AM Subject: Perl DBI vs SQLPLUS
> > > > I don't know if this is the way to trespond to your question and I > > apologize > > in advance if this is not appropriate. > > > > I've got a question regarding SQL*PLUS and DBI > > The following query in Oracle, using sql*plus, takes 2.3 seconds. > > > > Using perl DBI, it takes over 4 minutes. Can't understand why DBI whould be any slower. Are you *positive* it is the *exact* same query? Try writing $oracle_query out do a file and then run that using sqlplus. Also, run an EXPLAIN PLAN on it and see what the execution plan looks like. > > > > Any ideas what to do? > > > > $oracle_query = 'select c.object_name,c.column_name, c.column_desc > > from abbr_ref b, meta_column_master c, meta_node_ref o > > where (b.word like \'%'.$wanted_value.'%\' > > or b.abbr like \''.$wanted_value.'%\' > > or c.column_name like \''.$wanted_value.'\' > > or upper(c.bus_name) like \'%'.$wanted_value.'%\' > > or upper(c.column_desc) like \'%'.$wanted_value.'%\') > > and b.abbr = o.node > > and o.column_name like c.column_name This join condition looks suspiscious. Shouldn't that be o.column_name = c.column_name ? Oracle probably can't optimize that join. > > group by c.object_name,c.column_name,c.column_desc > > order by 1,2,3'; > > > > > > I am using the following to fetch the rows: > > while(($object_name,$column_name,$column_desc) = $sth->fetchrow_array) { That should be fine. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]