Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: quick easy question, Please Answer

Re: quick easy question, Please Answer

From: Connor McDonald <connor_mcdonald_at_yahoo.com>
Date: Mon, 26 Jul 1999 20:41:42 +0800
Message-ID: <379C5786.3446@yahoo.com>


itabl7up_at_yahoo.com wrote:
>
> Basically my question is, whether it would be faster to query 4 tables
> (each with about 5000 rows) with query like this:
> select count(*) from table where rid=number;
> with table having an index on rid.
>
> or faster to query one table (with about 20,000 rows) like this:
> select count(*) from table where rid=number and time=varchar[8];
> I would make an index on this table with (rid,time) or 2 indexes, one
> with rid, the other with time.
> Let me know, thanks.
> James Thomson
> itabl7up_at_yahoo.com
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.

Very much depends on your data distribution...Why not try both in an experiment with some typical data and check you results ???

SQL> alter session set sql_trace = true;

SQL> (do your testing)

SQL alter session set sql_trace = false;

which will create a file in the directory nominated by 'user_dump_dest' in your init.ora. run tkprof on this (tkprof filename outputfilename) then have a look at outputfilename...

HTH
--



Connor McDonald
"These views mine, no-one elses etc etc" connor_mcdonald_at_yahoo.com

"Some days you're the pigeon, and some days you're the statue." Received on Mon Jul 26 1999 - 07:41:42 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US