Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: quick easy question, Please Answer
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
--
"Some days you're the pigeon, and some days you're the statue." Received on Mon Jul 26 1999 - 07:41:42 CDT
![]() |
![]() |