|
-
 Originally Posted by mitpat121
Hi
sorry
correct display is as follows
select * from employee
where status = 1;
30
select * from employee
where status = -1;
521
Is the table 551 rows in size?
As a rule of thumbs Oracle optimizer would not use an index when more than 15% of the rows have to be retrieved - it is cheaper in terms of I/O to do a full table scan.
Pablo (Paul) Berzukov
Author of Understanding Database Administration available at amazon and other bookstores.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
-
Hi all,
how can i find stale stats on particular table.
-
Please make a note that if you are using Oracle 10g or above, Oracle has a inbuilt scheduled maintenance job which collect the stats for the required objects as and when needed.
However, follow the below steps to check.
1. count the rows in the table (select count(*) from table)
2. check last_analyzed_date, num_rows from user_tables. num_rows should match with count(*)
I am not sure if there are any dictionary views available to find the same.
Thanks,
Vijay Tummala
Try hard to get what you like OR you will be forced to like what you get.
-
looks like There are more record with status=-1.So optimizer is using FTS.
Since no of records with status=1 is less optimizer is using Index scan.
-
hi all,
I am facing performance issue, fornt end these queries are used, it takes 4-5 minutes to load module application page. erlier it was taking max 30 seconds.
plz provide some suggetions
thx
-
find if stats for table is stale
use dba_tab_statistics table
-
Thanks for shedding more light Mohith. STALE_STATS column in ALL_TAB_STATISTICS is telling about the stale stats.
Thanks,
Vijay Tummala
Try hard to get what you like OR you will be forced to like what you get.
-
hi all,
i checked dba_tab_statistics for stale stats
but STALE_STATS column contain no and null values.
null value for global temporary table what is it mean and
one more thing i noticed global temporary table has never been analyzed.
plz provide suggetions
thx
-
 Originally Posted by mitpat121
hi all,
i checked dba_tab_statistics for stale stats
but STALE_STATS column contain no and null values.
null value for global temporary table what is it mean and
one more thing i noticed global temporary table has never been analyzed.
plz provide suggetions
thx
that is quite obvious. They are Global TEMPORARY Tables. Please google it for more information.
Thanks,
Last edited by vnktummala; 07-29-2010 at 12:46 AM.
Reason: typo
Vijay Tummala
Try hard to get what you like OR you will be forced to like what you get.
-
I second Mohit123, the optimizer algorithm would find it easier to use an index on the table to find +1 because they are much lesser in number and probably distributed throughout the table and would not use an index if its -1 because its easier to pick the whole thing into memory and find what is required instead of index scan and iterations.
If you really want to test out the optimizer working, you should make this a much bigger table in a test environment with similar distribution of data. It is then likely to use an index in both cases.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|