Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: 3 table query question
Thank you for your response.
I have just read your problem again and I have noticed you mentioned you
used the COST BASE
optimization mode.
This mode runs efficiently only if your table statistics are updated.
To do so, for each table :
analyze table my_table estimate statistics;
Or simply use the rull based approach : alter session set optimizer_goal=rule;
Or just put the following hint in your query : select /*+ RULE */ etc...
Please note that in the rule based approach the order of tables in the from clause is important.
To answer your last question, I would say that when you issue a select
count(*) statement
you just want to know the number of rows meeting a conditon concerning
indexed columns, you don't want to extract the rows themselves. Hence you
don't need to access the table data not being part of the index. You would
probably get the same result by selecting a field being part of the index.
Salut Received on Wed Jun 24 1998 - 16:39:00 CDT