{"id":9645,"date":"2017-01-05T15:52:46","date_gmt":"2017-01-05T14:52:46","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/12cr2-no-cardinality-feedback-for-small-queries\/"},"modified":"2017-01-05T15:52:46","modified_gmt":"2017-01-05T14:52:46","slug":"12cr2-no-cardinality-feedback-for-small-queries","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/12cr2-no-cardinality-feedback-for-small-queries\/","title":{"rendered":"12cR2: no cardinality feedback for small queries"},"content":{"rendered":"<h2>By Franck Pachot<\/h2>\n<p>.<br \/>\nThis follows the comments on Clemens Bleile post about SQL Plan Directives in Oracle 12.2 where he discovered a new behavior that is not documented. The feature is good: bypass the cardinality feedback overhead when the query is fast anyway.<\/p>\n<h3>Feature<\/h3>\n<p>In Clemens Bleile post about <a href=\"http:\/\/dbi-services.com\/blog\/sql-plan-directives-in-12cr2-behavior-is-different-than-in-12cr1\/\">SQL Plan Directives changes in 12<em>c<\/em>R2<\/a> he determined than the new feature coming in bug 23596611 was responsible for the bypass of automatic reoptimization (the 12<em>c<\/em> cardinality feedback) in some cases.<\/p>\n<p>The description gives the idea that the reason for the bypass of cardinality feedback is &#8216;small queries&#8217;:<\/p>\n<pre><code>SQL&gt; select BUGNO,SQL_FEATURE,DESCRIPTION,OPTIMIZER_FEATURE_ENABLE from v$system_fix_control where bugno=23596611;\n&nbsp;\n     BUGNO SQL_FEATURE                    DESCRIPTION                            OPTIMIZER_FEATURE_ENABLE\n---------- ------------------------------ -------------------------------------- -------------------------\n  23596611 QKSFM_STATS_FEEDBACK_23596611   No feedback for small queries         12.2.0.1<\/code><\/pre>\n<p>This is a new concept and in the traces we know there is nothing about &#8216;small queries&#8217;. Here is how to get more information.<\/p>\n<h3>Function<\/h3>\n<p>First, I&#8217;m looking for the &#8216;small queries&#8217; text in the oracle executable:<\/p>\n<pre><code>$ strings $ORACLE_HOME\/bin\/oracle | grep \"small query\"\nkkocfbCheckCardEst: No feedback for small query (BG %f, CPU %f (ms)\nkkocfbCompareExecStats: skipping cost comparision forsmall query (BG %f, CPU %f (ms)<\/code><\/pre>\n<p>Good. This looks like there is a way to trace some information about that bypass decision, and there&#8217;s a clue that &#8216;small queries&#8217; are evaluated on number of buffer gets (BG) and CPU time threshold. More than that, we have the name of the C function that traces this: kkocfbCheckCardEst<\/p>\n<p>kkocfb probably means:<\/p>\n<blockquote class=\"twitter-tweet\" data-width=\"550\" data-dnt=\"true\">\n<p lang=\"en\" dir=\"ltr\"><a href=\"https:\/\/x.com\/johnnyq72?ref_src=twsrc%5Etfw\">@johnnyq72<\/a> it\u2019s kernel kompile costing cardinality feedback probably. and it seems there is a trace function&#8230;<\/p>\n<p>&mdash; Frits Hoogland (@fritshoogland) <a href=\"https:\/\/x.com\/fritshoogland\/status\/816763076800380929?ref_src=twsrc%5Etfw\">January 4, 2017<\/a><\/p><\/blockquote>\n<p><script async src=\"https:\/\/platform.x.com\/widgets.js\" charset=\"utf-8\"><\/script><\/p>\n<p>and then I&#8217;m looking for a way to get this trace. I didn&#8217;t know which event can trace that, but others know:<\/p>\n<p>https:\/\/twitter.com\/Mautro\/status\/816772241635627008<\/p>\n<p>However there is another way to get an idea of the events that are checked by a function.<br \/>\nThe idea is described here: <a href=\"http:\/\/yong321.freeshell.org\/computer\/OracleFuncCalls.html\">http:\/\/yong321.freeshell.org\/computer\/OracleFuncCalls.html<\/a><\/p>\n<h3>Event<\/h3>\n<p>We are not allowed to disassemble oracle code (this is in the licensing rules that you accept when you download oracle) so I&#8217;ll not do it here.<br \/>\nIf you think you have a special permission to do it, just run:<\/p>\n<pre><code>gdb oracle &lt;&lt;&lt;&quot;disas kkocfbCheckCardEst&quot;<\/code><\/pre>\n<p>I can&#8217;t show the dissassembled code, so here is how to get the list of the events that are checked by the kkocfbCheckCardEst function:<\/p>\n<pre><code>$ gdb oracle &lt;&lt;&lt;&quot;disas kkocfbCheckCardEst&quot; | awk --non-decimal-data &#039;\/mov .*,%edi$\/{gsub(\/[$,]\/,&quot; &quot;);a=$4}\/EventRdbmsErr\/{printf &quot;%dn&quot;, a}&#039; | sort -u\n10507<\/code><\/pre>\n<p>The information we have about this event does not describe all what can be traced:<\/p>\n<pre><code>$ oerr ora 10507\n10507, 00000, \"Trace bind equivalence logic\"\n\/\/ *Cause:\n\/\/ *Action:<\/code><\/pre>\n<p>From that, I don&#8217;t know which level to set the event, but in case of doubt and because levels are often bit flags, you can set it to the maximum 0xFFFFFFFF:<\/p>\n<pre><code>\nalter session set events '10507 trace name context forever, level 4294967295';\n<\/code><\/pre>\n<h3>trace when cardinality feedback is bypassed<\/h3>\n<p>When I run the query where execution is doing less than 100 buffer gets I get the following trace with event 10507 level 512:<\/p>\n<pre><code>\n****** Begin CFB Hints (APA) [sql_id=a71qw8t17qpqq] xsc=0x7fca901f0e30 ctx=0x9415d4f8 ******\nDumping Hints\n=============\n*********** End CFB Hints (APA) ***********\nkkocfbInitCardFdbkCompCtx [sql_id=a71qw8t17qpqq] monitor=y\nkkocfbCheckCardEst: No feedback for small query (BG 0.000000, CPU 0.000000 (ms)\n<\/code><\/pre>\n<p>The message is clear: no feedback for small query. The Buffer Get and CPU show 0 but on my test case, increasing the size of the table, I have seen that 100 buffer gets is the threshold:<\/p>\n<pre><code>\nbq4fc1rdx97av is_reoptimizable: N                buffer_gets:          95 cpu_time:          0\nbq4fc1rdx97av is_reoptimizable: N                buffer_gets:          95 cpu_time:       1000\nbq4fc1rdx97av is_reoptimizable: N                buffer_gets:          96 cpu_time:       1000\nbq4fc1rdx97av is_reoptimizable: N                buffer_gets:          96 cpu_time:       1000\nbq4fc1rdx97av is_reoptimizable: N                buffer_gets:          97 cpu_time:          0\nbq4fc1rdx97av is_reoptimizable: N                buffer_gets:          97 cpu_time:          0\nbq4fc1rdx97av is_reoptimizable: N                buffer_gets:          98 cpu_time:       1000\nbq4fc1rdx97av is_reoptimizable: N                buffer_gets:          98 cpu_time:          0\nbq4fc1rdx97av is_reoptimizable: N                buffer_gets:          99 cpu_time:       1000\nbq4fc1rdx97av is_reoptimizable: N                buffer_gets:          99 cpu_time:          0\nbq4fc1rdx97av is_reoptimizable: Y                buffer_gets:         100 cpu_time:       1000\nbq4fc1rdx97av is_reoptimizable: Y                buffer_gets:         100 cpu_time:       1000\nbq4fc1rdx97av is_reoptimizable: Y                buffer_gets:         101 cpu_time:       1000\nbq4fc1rdx97av is_reoptimizable: Y                buffer_gets:         101 cpu_time:          0\nbq4fc1rdx97av is_reoptimizable: Y                buffer_gets:         102 cpu_time:          0\nbq4fc1rdx97av is_reoptimizable: Y                buffer_gets:         102 cpu_time:       1000\n<\/code><\/pre>\n<h3>trace when query becomes reoptimizable<\/h3>\n<p>When the query reads more than 100 buffer gets, the cursor is marked as reoptimizable and here is the trace:<\/p>\n<pre><code>\n****** Begin CFB Hints (APA) [sql_id=a71qw8t17qpqq] xsc=0x7fed7dc2ca40 ctx=0x9418f4f8 ******\nDumping Hints\n=============\n*********** End CFB Hints (APA) ***********\nkkocfbInitCardFdbkCompCtx [sql_id=a71qw8t17qpqq] monitor=y\nReparsing due to card est...\n @=0x95426550 type=1 nodeid=1 monitor=Y halias=\"DEMO_TABLE\" loc=\"SEL$1\" act=500 min=0 est=63 next=(nil)\nkkocfbCheckCardEst [sql_id=a71qw8t17qpqq] reparse=y ecs=n efb=n ost=n fbs=n\n *********** Begin Dump Context (kkocfbCheckCardEst) [sql_id=a71qw8t17qpqq cpcnt=0] ***********\n @=0x95426550 type=1 nodeid=1 monitor=Y halias=\"DEMO_TABLE\" loc=\"SEL$1\" act=500 min=0 est=63 next=(nil)\n *********** End Dump Context ***********\n<\/code><\/pre>\n<p>act=500 is the actual number of rows (A-Rows) and est=63 is the estimated one (A-Rows) and this is how misestimate is detected.<\/p>\n<h3>trace when reoptimized query is run again<\/h3>\n<p>At that point we can see the feedback as OPT_ESTIMATE hints in v$sql_reoptimization_hints.<\/p>\n<p>When we run the same query another time, it is parsed again with those hits, fixing cardinality tho the A-Rows of previous execution.<\/p>\n<p>Here is the trace for this second execution.<\/p>\n<pre><code>\nkkoarCopyCtx: [sql_id=a71qw8t17qpqq] origin=CFB old=0x63904140 new=0x7fcda3716d40 copyCnt=1 copyClient=y\n**************************************************************\nkkocfbCopyBestEst: Best Stats\n  Exec count:         1\n  CR gets:            279\n  CU gets:            4\n  Disk Reads:         0\n  Disk Writes:        0\n  IO Read Requests:   0\n  IO Write Requests:  0\n  Bytes Read:         0\n  Bytes Written:      0\n  Bytes Exchanged with Storage:  0\n  Bytes Exchanged with Disk:  0\n  Bytes Simulated Read:  0\n  Bytes Simulated Returned:  0\n  Elapsed Time: 6998 (us)\n  CPU Time: 2000 (us)\n  User I\/O Time: 0 (us)\n *********** Begin Dump Context (kkocfbCopyBestEst) **********\n *********** End Dump Context ***********\nkkocfbCopyCardCtx: oldCtx Dumping string mapping\n----------------------\nkkocfbCopyCardCtx: newCtx Dumping string mapping\n----------------------\n**************************************************************\nkkocfbCopyCardCtx: Best stats\n  Exec count:         1\n  CR gets:            279\n  CU gets:            4\n  Disk Reads:         0\n  Disk Writes:        0\n  IO Read Requests:   0\n  IO Write Requests:  0\n  Bytes Read:         0\n  Bytes Written:      0\n  Bytes Exchanged with Storage:  0\n  Bytes Exchanged with Disk:  0\n  Bytes Simulated Read:  0\n  Bytes Simulated Returned:  0\n  Elapsed Time: 6998 (us)\n  CPU Time: 2000 (us)\n  User I\/O Time: 0 (us)\n **** Begin Dump Context (kkocfbCopyCardCtx - best est) ****\n ********************* End Dump Context ********************\n   *********** Begin Dump Context (Copy:old) [sql_id=a71qw8t17qpqq cpcnt=0] ***********\n   @=0x6446dc58 type=1 nodeid=1 monitor=Y halias=\"DEMO_TABLE\" loc=\"SEL$1\" act=500 min=0 est=63 next=(nil)\n   *********** End Dump Context ***********\n   *********** Begin Dump Context (Copy:new) [sql_id=a71qw8t17qpqq cpcnt=0] ***********\n   @=0x7fcda3716a78 type=1 nodeid=1 monitor=Y halias=\"DEMO_TABLE\" loc=\"SEL$1\" act=500 min=0 est=63 next=(nil)\n   *********** End Dump Context ***********\nkkoarReparse: xsc=0x7fcda3672b98 kxsAutoReoptCtx=0x7fcda3716d40\nkkocfbAddCardHints: Dumping string mapping\n----------------------\n******** Begin CFB Hints [sql_id=a71qw8t17qpqq]  xsc=0x7fcda3672b98 ********\nDumping Hints\n=============\n  atom_hint=(@=0x7fcda37831e8 err=0 resol=0 used=0 token=1018 org=6 lvl=3 txt=OPT_ESTIMATE (@\"SEL$1\" TABLE \"DEMO_TABLE\"@\"SEL$1\" ROWS=500.000000 ) )\n********** End CFB Hints **********\n<\/code><\/pre>\n<p>You can see the OPT_ESTIMATE hints here.<\/p>\n<pre><code>\n****** Begin CFB Hints (APA) [sql_id=a71qw8t17qpqq] xsc=0x7fcda3672b98 ctx=0x8a274118 ******\nDumping Hints\n=============\n  atom_hint=(@=0x7fcda37831e8 err=0 resol=1 used=0 token=1018 org=6 lvl=3 txt=OPT_ESTIMATE (@\"SEL$1\" TABLE \"DEMO_TABLE\"@\"SEL$1\" ROWS=500.000000 ) )\n  atom_hint=(@=0x7fcda3782d10 err=0 resol=1 used=0 token=1018 org=6 lvl=3 txt=OPT_ESTIMATE (@\"SEL$1\" TABLE \"DEMO_TABLE\"@\"SEL$1\" ROWS=500.000000 ) )\n*********** End CFB Hints (APA) ***********\nkkocfbInitCardFdbkCompCtx [sql_id=a71qw8t17qpqq] monitor=y\n**************************************************************\nkkocfbCopyBestEst: Best Stats\n  Exec count:         1\n  CR gets:            279\n  CU gets:            4\n  Disk Reads:         0\n  Disk Writes:        0\n  IO Read Requests:   0\n  IO Write Requests:  0\n  Bytes Read:         0\n  Bytes Written:      0\n  Bytes Exchanged with Storage:  0\n  Bytes Exchanged with Disk:  0\n  Bytes Simulated Read:  0\n  Bytes Simulated Returned:  0\n  Elapsed Time: 6998 (us)\n  CPU Time: 2000 (us)\n  User I\/O Time: 0 (us)\n *********** Begin Dump Context (kkocfbCopyBestEst) **********\n *********** End Dump Context ***********\nkkocfbCheckCardEst [sql_id=a71qw8t17qpqq] reparse=n ecs=n efb=y ost=n fbs=n\n<\/code><\/pre>\n<h3>So what?<\/h3>\n<p>With those adaptive feature it is good to be able to trace the decisions in order to understand and reproduce the problems we encounter. Event 10507 is very useful. It&#8217;s the execution time counterpart for the event 10053 which explains compile time decision. And in latest versions, the optimizer is more and more present at execution time.<\/p>\n<p>We have always seen problems coming from cardinality feedback. Most of them are coming from bad statistics or a data model where there is not one optimal access plan. Then the CBO is always trying to find better and sometimes the best is the enemy of the good.<br \/>\nNow in 12.2 you have a very good way to avoid the cardinality feedback side effect: tune your queries and your data model so that the critical queries read less than 100 logical reads.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>By Franck Pachot . This follows the comments on Clemens Bleile post about SQL Plan Directives in Oracle 12.2 where he discovered a new behavior that is not documented. The feature is good: bypass the cardinality feedback overhead when the query is fast anyway. Feature In Clemens Bleile post about SQL Plan Directives changes in&hellip;&nbsp;<\/p>\n","protected":false},"author":27,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","neve_meta_reading_time":"","_themeisle_gutenberg_block_has_review":false,"footnotes":""},"categories":[4133],"tags":[349,1025,1013],"class_list":["post-9645","post","type-post","status-publish","format-standard","category-database","tag-optimizer","tag-oracle-12cr2","tag-spd"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v28.8 (Yoast SEO v28.9) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>12cR2: no cardinality feedback for small queries - dbi services Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dbi-services.com\/blog\/12cr2-no-cardinality-feedback-for-small-queries\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"12cR2: no cardinality feedback for small queries\" \/>\n<meta property=\"og:description\" content=\"By Franck Pachot . This follows the comments on Clemens Bleile post about SQL Plan Directives in Oracle 12.2 where he discovered a new behavior that is not documented. The feature is good: bypass the cardinality feedback overhead when the query is fast anyway. Feature In Clemens Bleile post about SQL Plan Directives changes in&hellip;&nbsp;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/12cr2-no-cardinality-feedback-for-small-queries\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi services Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/dbiservices\/\" \/>\n<meta property=\"article:published_time\" content=\"2017-01-05T14:52:46+00:00\" \/>\n<meta name=\"author\" content=\"Oracle Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@dbiservices\" \/>\n<meta name=\"twitter:site\" content=\"@dbiservices\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Oracle Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/12cr2-no-cardinality-feedback-for-small-queries\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/12cr2-no-cardinality-feedback-for-small-queries\\\/\"},\"author\":{\"name\":\"Oracle Team\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/bf7c7eb0bec165183207237c9d0ee1d5\"},\"headline\":\"12cR2: no cardinality feedback for small queries\",\"datePublished\":\"2017-01-05T14:52:46+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/12cr2-no-cardinality-feedback-for-small-queries\\\/\"},\"wordCount\":681,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/#organization\"},\"keywords\":[\"Optimizer\",\"Oracle 12cR2\",\"SPD\"],\"articleSection\":[\"Database\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/12cr2-no-cardinality-feedback-for-small-queries\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/12cr2-no-cardinality-feedback-for-small-queries\\\/\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/12cr2-no-cardinality-feedback-for-small-queries\\\/\",\"name\":\"12cR2: no cardinality feedback for small queries - dbi services Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#website\"},\"datePublished\":\"2017-01-05T14:52:46+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/12cr2-no-cardinality-feedback-for-small-queries\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/12cr2-no-cardinality-feedback-for-small-queries\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/12cr2-no-cardinality-feedback-for-small-queries\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"12cR2: no cardinality feedback for small queries\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\",\"name\":\"dbi services Blog\",\"description\":\"#BeSharing\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/#organization\",\"name\":\"dbi services\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/dbi-services-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/dbi-services-logo.png\",\"width\":512,\"height\":512,\"caption\":\"dbi services\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/dbiservices\\\/\",\"https:\\\/\\\/x.com\\\/dbiservices\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/dbi-services\\\/\",\"https:\\\/\\\/www.youtube.com\\\/user\\\/dbiservices\"],\"description\":\"Swiss IT consulting and services company specialized in efficient data infrastructures and platforms: databases, application servers, cloud, DevOps, digitalization, analytics, data quality and monitoring. Headquartered in Del\u00e9mont with offices in Nyon, Basel, Bern and Zurich.\",\"email\":\"info@dbi-services.com\",\"telephone\":\"+41 32 422 96 00\",\"legalName\":\"dbi services SA\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/bf7c7eb0bec165183207237c9d0ee1d5\",\"name\":\"Oracle Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/12\\\/oracle-square.png\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/12\\\/oracle-square.png\",\"contentUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/12\\\/oracle-square.png\",\"caption\":\"Oracle Team\"},\"description\":\"Posts published under the Oracle Team account are collective contributions by the dbi services Oracle consultants. The practice covers the full Oracle Database lifecycle: architecture, migration and upgrade, high availability with RAC and Data Guard, backup and recovery, performance tuning, and engineered systems such as Oracle Database Appliance and Exadata. The team holds Oracle certifications up to Certified Master level and operates customer platforms under service level agreements.\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/author\\\/oracle-team\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"12cR2: no cardinality feedback for small queries - dbi services Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dbi-services.com\/blog\/12cr2-no-cardinality-feedback-for-small-queries\/","og_locale":"en_US","og_type":"article","og_title":"12cR2: no cardinality feedback for small queries","og_description":"By Franck Pachot . This follows the comments on Clemens Bleile post about SQL Plan Directives in Oracle 12.2 where he discovered a new behavior that is not documented. The feature is good: bypass the cardinality feedback overhead when the query is fast anyway. Feature In Clemens Bleile post about SQL Plan Directives changes in&hellip;&nbsp;","og_url":"https:\/\/www.dbi-services.com\/blog\/12cr2-no-cardinality-feedback-for-small-queries\/","og_site_name":"dbi services Blog","article_publisher":"https:\/\/www.facebook.com\/dbiservices\/","article_published_time":"2017-01-05T14:52:46+00:00","author":"Oracle Team","twitter_card":"summary_large_image","twitter_creator":"@dbiservices","twitter_site":"@dbiservices","twitter_misc":{"Written by":"Oracle Team","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/12cr2-no-cardinality-feedback-for-small-queries\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/12cr2-no-cardinality-feedback-for-small-queries\/"},"author":{"name":"Oracle Team","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/bf7c7eb0bec165183207237c9d0ee1d5"},"headline":"12cR2: no cardinality feedback for small queries","datePublished":"2017-01-05T14:52:46+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/12cr2-no-cardinality-feedback-for-small-queries\/"},"wordCount":681,"commentCount":0,"publisher":{"@id":"https:\/\/www.dbi-services.com\/#organization"},"keywords":["Optimizer","Oracle 12cR2","SPD"],"articleSection":["Database"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/12cr2-no-cardinality-feedback-for-small-queries\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/12cr2-no-cardinality-feedback-for-small-queries\/","url":"https:\/\/www.dbi-services.com\/blog\/12cr2-no-cardinality-feedback-for-small-queries\/","name":"12cR2: no cardinality feedback for small queries - dbi services Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"datePublished":"2017-01-05T14:52:46+00:00","breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/12cr2-no-cardinality-feedback-for-small-queries\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/12cr2-no-cardinality-feedback-for-small-queries\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/12cr2-no-cardinality-feedback-for-small-queries\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"12cR2: no cardinality feedback for small queries"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi services Blog","description":"#BeSharing","publisher":{"@id":"https:\/\/www.dbi-services.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.dbi-services.com\/#organization","name":"dbi services","url":"https:\/\/www.dbi-services.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2026\/09\/dbi-services-logo.png","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2026\/09\/dbi-services-logo.png","width":512,"height":512,"caption":"dbi services"},"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/dbiservices\/","https:\/\/x.com\/dbiservices","https:\/\/www.linkedin.com\/company\/dbi-services\/","https:\/\/www.youtube.com\/user\/dbiservices"],"description":"Swiss IT consulting and services company specialized in efficient data infrastructures and platforms: databases, application servers, cloud, DevOps, digitalization, analytics, data quality and monitoring. Headquartered in Del\u00e9mont with offices in Nyon, Basel, Bern and Zurich.","email":"info@dbi-services.com","telephone":"+41 32 422 96 00","legalName":"dbi services SA"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/bf7c7eb0bec165183207237c9d0ee1d5","name":"Oracle Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/12\/oracle-square.png","url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/12\/oracle-square.png","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/12\/oracle-square.png","caption":"Oracle Team"},"description":"Posts published under the Oracle Team account are collective contributions by the dbi services Oracle consultants. The practice covers the full Oracle Database lifecycle: architecture, migration and upgrade, high availability with RAC and Data Guard, backup and recovery, performance tuning, and engineered systems such as Oracle Database Appliance and Exadata. The team holds Oracle certifications up to Certified Master level and operates customer platforms under service level agreements.","url":"https:\/\/www.dbi-services.com\/blog\/author\/oracle-team\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/9645","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/27"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=9645"}],"version-history":[{"count":0,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/9645\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=9645"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=9645"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=9645"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}