The check found the following statement to be suspicious
Select Auditstatus,categoryid, AuditLevel from categoryarticleassign a,category b where B.id=a.categoryid and articleid= 20030700400141 and auditstatus& Gt;0call count CPU Elapsed disk query current rows----------------------------------------------------------------- ------Parse 1 0.00 0.00 0 0 0 0Execute 1 0.00 0.00 0 0 0 0Fetch 1 0.81 0.81 0 3892 0 1-------------------------------- ---------------------------------------Total 3 0.81 0.81 0 3892 0 1************************************************** ******************************
This is clearly based on ArticleID for news reading.
What's suspicious is that query reads 3892
This content caught my attention.
If you have a similar problem, you should know what's going on here.
If you haven't met a friend, you can think about it here and look down.
We note that the Idx_articleid index is not used in any of the above queries.
Check table structure:
sql> desc categoryarticleassign Name Null? Type-----------------------------------------------------------------------------CategoryID not NULL number ArticleID NOT NULL VARCHAR2 (a) Assigntype NOT null VARCHAR2 (1) auditstatus NOT NULL number SortID NOT NULL number Unpass VARCHAR2 (255)
Problem Discovery:
Because ArticleID is a character-type data, the articleid= 20030700400141 given in the query is a numeric value
Oracle has potential data type conversions, resulting in index invalidation
Sql> Select Auditstatus,categoryid 2 from 3 categoryarticleassign where articleid=20030700400132; Auditstatus CategoryID---------------------9 0 383 0 695 elapsed:00:00:02.62execution Plan------------------------- ---------------------------------0 SELECT STATEMENT optimizer=choose (cost=110 card=2 bytes=38) 1 0 TABLE ACCESS (full) O F ' categoryarticleassign ' (cost=110 card=2 bytes=38)
4. How to Solve
Simply add one on each side of the parameter to solve the problem.
For similar queries, we found that query mode reads down to 2
It's hardly going to take CPU time.
Select Unpass from Categoryarticleassign where articleid= ' 20030320000682 ' and categoryid= ' 113 ' Call count CPU elapsed disk query current rows -----------------------------------------------------------------------Parse 1 0.00 0.00 0 0 0 0Execute 1 0.00 0.00 0 0 0 0Fetch 1 0.00 0.00 0 2 0 0-----------------------------------------------------------------------Total 3 0.0 0 0.00 0 2 0 0Misses in library cache during Parse:1optimizer goal:chooseparsing user id:20 Rows Row Source operation-- --------------------------------------------------------0 TABLE ACCESS by index ROWID categoryarticleassign 1 index RAN GE SCAN (Object ID 3080) ********************************************************************************
At this point, the problem has been satisfactorily resolved.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service