Weird question on implementation with the paragraph plan

OS: CentOS 5

Oracle 10.2.0.1

We are facing a weird problem.

The table is as

create table A)

key elementary/ID varchar2 (200)

...

)

ID's value is a bit special, because it starts by ' * ' (asterisk), and his motive is ' *' + 'onestring' + 'uuid '.

We have a query clause IN with 20 arguments such as:

Select * from where id in)

'* line_item.name.uuid1...',

'* line_item.name.uuid2...',

'* line_item.name.uuid3...',

'* line_item.name.uuid4...',

'* line_item.name.uuid5...',

'* line_item.name.uuid6...',

'* line_item.name.uuid7...',

'* line_item.name.uuid8...',

'* line_item.name.uuid9...',

'* line_item.name.uuid10...',

'* line_item.name.uuid11...',

....

)

Number of rows in the table is of 30 M, and the number of rows in the primary key index is also 30 M.

Select user_indexes index_name, blevel, num_rows where table_name = "A";


20 is a lot less than 30 M, but the execution of Oracle for this query plan is full table to a table scan.

I try to remove the ' *' in the id, then the plan execution is range limited index scan and then obtain registration of the line id. I think it should work this way.

Is ' *' a special character in Oracle 10 g?

Hi Nesta,

It's an interesting test case - behold, I get:

create table t

as

Select 'testtesttesttesttesttesttesttesttesttest ' | rownum id

, mod (rownum, 16) col2

, lpad ('* ', 50,' *') padding

of the double

connect by level<=>

ALTER table t add constraint primary key t_pk (id, col2);

exec dbms_stats.gather_table_stats (user, 't')

explain plan for

Select *.

t

where id in ("testtesttesttesttest1"

, "testtesttesttesttest2".

, "testtesttesttesttest3".

, "testtesttesttesttest4".

, "testtesttesttesttest5".

, "testtesttesttesttest6".

, "testtesttesttesttest7".

, "testtesttesttesttest8".

, "testtesttesttesttest9".

, "testtesttesttesttest10".

, "testtesttesttesttest11".

, "testtesttesttesttest12".

, "testtesttesttesttest13".

, "testtesttesttesttest14".

, "testtesttesttesttest15".

, "testtesttesttesttest16".

, "testtesttesttesttest17".

, "testtesttesttesttest18".

, "testtesttesttesttest19".

, "testtesttesttesttest20".

);

-------------------------------------------------------------------------------------

| ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time |

-------------------------------------------------------------------------------------

|   0 | SELECT STATEMENT |      |    20.  2020 |    27 (0) | 00:00:01 |

|   1.  INLIST ITERATOR.      |       |       |            |          |

|   2.   TABLE ACCESS BY INDEX ROWID | T    |    20.  2020 |    27 (0) | 00:00:01 |

|*  3 |    INDEX RANGE SCAN | T_PK |    20.       |    22 (0) | 00:00:01 |

-------------------------------------------------------------------------------------

--> still a scan interval index with cardinality 20

exec dbms_stats.delete_column_stats (user, ', 'ID')

-------------------------------------------------------------------------------------

| ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time |

-------------------------------------------------------------------------------------

|   0 | SELECT STATEMENT |      | 10000 |   937K |   851 (0) | 00:00:05 |

|   1.  INLIST ITERATOR.      |       |       |            |          |

|   2.   TABLE ACCESS BY INDEX ROWID | T    | 10000 |   937K |   851 (0) | 00:00:05 |

|*  3 |    INDEX RANGE SCAN | T_PK |  4000 |       |    42 (0) | 00:00:01 |

-------------------------------------------------------------------------------------

Information of predicates (identified by the operation identity card):

---------------------------------------------------

3 - access ("ID" = 'ID"= 'testtesttesttesttest10' OR'testtesttesttesttest1 '

OR 'ID' = 'testtesttesttesttest11' OR 'ID' = 'testtesttesttesttest12' OR

'ID' = 'testtesttesttesttest13' OR 'ID' = 'testtesttesttesttest14' OR

'ID' = 'testtesttesttesttest15' OR 'ID' = 'testtesttesttesttest16' OR

'ID' = 'testtesttesttesttest17' OR 'ID' = 'testtesttesttesttest18' OR

'ID' = 'testtesttesttesttest19' OR 'ID' = 'testtesttesttesttest2' OR

'ID' = 'testtesttesttesttest20' OR 'ID' = 'testtesttesttesttest3' OR

'ID' = 'testtesttesttesttest4' OR 'ID' = 'testtesttesttesttest5' OR

'ID' = 'testtesttesttesttest6' OR 'ID' = 'testtesttesttesttest7' OR

'ID' = 'testtesttesttesttest8' OR 'ID' = "testtesttesttesttest9")

--> now, we see le.004 factor in the calculation of the cardinality

exec dbms_stats.gather_table_stats (user, 't', method_opt => "for IDs of the columns");

exec dbms_stats.gather_table_stats (user, 't', method_opt => "for the column col2");

--------------------------------------------------------------------------

| ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time |

--------------------------------------------------------------------------

|   0 | SELECT STATEMENT |      |  1000K |    96 M |  7435 (0) | 00:00:38 |

|*  1 |  TABLE ACCESS FULL | T    |  1000K |    96 M |  7435 (0) | 00:00:38 |

--------------------------------------------------------------------------

--> After having re-creating column statistics I now also get the full table scan

What happens here? A look at column statistics the case becomes a little clearer:

Select column_name

num_distinct

Histogram

num_buckets

sample_size

of user_tab_cols

where table_name = 't'

COLUMN_NAME NUM_DISTINCT HISTOGRAM SAMPLE_SIZE NUM_BUCKETS

------------------------------ ------------ --------------- ----------- -----------

ID 988992 1 5616 FREQUENCY

COL2 FREQUENCY 16 16 5472

1. NO 1000000 1 PADDING

Select column_name

endpoint_number

endpoint_value

of user_tab_histograms

where table_name = 't';

COLUMN_NAME ENDPOINT_NUMBER ENDPOINT_VALUE

------------------------------ --------------- --------------

ID 5616 6, 0436E + 35

COL2                                       334              0

COL2                                       681              1

COL2                                      1008              2

COL2                                      1345              3

COL2                                      1717              4

COL2                                      2039              5

COL2                                      2388              6

COL2                                      2734              7

COL2                                      3089              8

COL2                                      3440              9

COL2                                      3797             10

COL2                                      4132             11

COL2                                      4473             12

COL2                                      4790             13

COL2                                      5128             14

COL2                                      5472             15

PADDING 0 2, 1893RD + 35

FILLING 1 2, 1893RD + 35

So we now have histograms of frequency for the two columns (created with a small sample of ~ 5500 lines - but this isn't the problem here): a histogram of the frequency must contain a bucket for each distinct value - but we have distinct values of 1 M and only a bucket. Of course, the CBO is not able to see the difference in values due to the great prefix. With histgrams the calculation of costs is another, and when he sees that a single bucket the optimizer would decide that such access does not bring a lot of selectivity.

So I'll be back to my initial index access when I recreate the column without histograms statistics:

exec dbms_stats.gather_table_stats (user, ' t ', method_opt => ' ID columns size 1');

exec dbms_stats.gather_table_stats (user, ' t ', method_opt => "for the column col2 size 1');

In his blog, Jonathan Lewis wrote: "If you have fairly similar, and long strings in a column that is a good candidate for a histogram of the frequency (for example a very descriptive status column) then you have a problem, if a value which is very rare looks identical to a very popular value until the first 32 characters." http://jonathanlewis.wordpress.com/2010/10/13/frequency-histogram-5/ - and also says that the situation is changed to 12 c, but that's a different story.

Concerning

Martin

Tags: Database

Similar Questions

  • How to change the source of data in application with the deployment plan

    Hello

    JDev Version: 12.1.3

    I can't change the source data with the deployment plan bc4j.

    Any example on this requirement?

    Thank you

    Anil

    Well, if you take a look at:

    http://Biemond.blogspot.com/2009/04/using-WebLogic-deployment-plan-to.html

    (one of the links in the link you get), you will see Edvin Biemond answwer:

    "you must change the configuration of module of the Application so that it uses a data source. and in the deployment of applications disable deployment of jdbc connection.

    Now you is enough to make the good source of data on each wls and deploy ears. »

    The simplest (and probably the best) way is, as I told you, and you are also mentioned: open up JDeveloper and change declaratively and re-download the ears

  • Find/replace, searching for specific text to replace it with the paragraph tag

    I tried to replace a string of text that I have at the beginning of a paragraph indicating a certain style of paragraph with this style of ID while eliminating the text string. For example, I put @IN1 at the beginning of a paragraph I want formatted with the paragraph of my ID IN1 style. However, when I have 'Search' @IN1 with no. find format and 'to' do not change (i.e. empty) with the paragraph style selected 1 selected under format change, it applies the paragraph style, but does not delete the text string @IN1. When you do a search/replace without the portion of paragraph desired syle, he removes the @IN1 correctly. It is a bug, or is there something I have to put in the change of area indicate no text? Thank you

    Using the GREP tab, find ^ (@IN1) (.) and replace with $2 and set the paragraph style in the change of format.

    The ^ beginning of paragraph says and the $2 is the second subexpression matching.

  • Creative cloud storage limit not sync with the management plan. 2 GB display on the application instead of 100 GB.

    Creative cloud storage limit not sync with the management plan. 2 GB display on the application instead of 100 GB.

    Hi Christian,

    Please check the help below document:

    Applications creative Cloud back in test mode after an update until 2015 for CC

    Kind regards

    Sheena

  • Questions and Confusion with the game automatic and unable to implement the ReadyBoost for a storage device

    OK, I tried to set up the Readyboost on one of my flash drives and to do this, access the AutoPlay window. I followed several instructions and advice from several Web sites, I tried to click with the right button on the flash drive in the computer menu, but the AutoPlay option does not appear. And when I go to the control panel section and where is automatic playback, the flash player is not registered under the devices section. I also tried to go to the command prompt as administrator by typing "net start shellhwdetection '. However, who told me that this service was already active. Can someone please help me configure AutoPlay to my flash drive so I can set up the ReadyBoost

    OK, I tried to set up the Readyboost on one of my flash drives and to do this, access the AutoPlay window. I followed several instructions and advice from several Web sites, I tried to click with the right button on the flash drive in the computer menu, but the AutoPlay option does not appear. And when I go to the control panel section and where is automatic playback, the flash player is not registered under the devices section. I also tried to go to the command prompt as administrator by typing "net start shellhwdetection '. However, who told me that this service was already active. Can someone please help me configure AutoPlay to my flash drive so I can set up the ReadyBoost

    Hey RayRay43

    You must make sure that the flash player is suitable for readyboost

    read all the information on the setup of readyboost to bleepingcomputer tutorial link below

    http://www.bleepingcomputer.com/tutorials/tutorial136.html

    have a happy holiday season

    Walter, the time zone traveller

  • Problem with the paragraph style "paragraph NET."

    I have a paragraph style with a paragraph in her net. There is something that I don't know what to do about it.

    When I hit 'back' to move a paragraph with this style, it leaves a rule in its wake. Here is a screenshot:

    Screen shot 2010-08-15 at 9.58.04 AM.png

    The title "Introduction" has a paragraph with a net of applied paragraph style. I put the cursor just before the word 'Introduction', press return, and it leaves a line in the previous line. Weird huh?

    Don't use not paragraph refers ALWAYS to put in place a space between paragraphs. Use the space before or after the space in the paragraph in withdrawal and spacing Style.

    If it's the beginning of a block of text and you want it to appear lower in the frame adjust them the object > text frame Options and give him a Medallion from the top. OR this way http://indesignsecrets.com/push-down-the-first-line-of-text.php

    The line of paragraph appears is because when you press back the paragraph he the same paragraph style, ergo the same paragraph style. To get rid of it, change the paragraph style from the paragraph above to something else.

    But you shouldn't really use back to add a space between paragraphs. Space before and after the space are much more effective.

    http://blogs.Adobe.com/indesigndocs/2009/05/5_typing_rules.html

    http://creativementor.com.au/adding-space-after-paragraphs

    http://help.Adobe.com/en_US/InDesign/6.0/WSa285fff53dea4f8617383751001ea8cb3f-6dcea.html

  • My AirPort Extreme end not implemented with the help of AirPort Utility

    Bought a used AirPort Extreme (Genesis 4) of a person who showed me that he worked at home. When I try to set up as a Wireless extender to my last existing AirPort Extreme, he will not carry out synchronization upward with AirPort Utility. It appears as a new extreme, but get a message 'unexpected error' before or after the name. Have you tried to reset the two while it is powered and turning the as explained in the help.

    When I try to set up as a Wireless extender...

    Gen 4 airport will connect to your existing AirPort Extreme wireless... or... it will connect using wired Ethernet wired, Permanent?

    .. .it will not accomplish the synchronization upward with AirPort Utility.

    Which version of AirPort Utility?  If it's on your Mac... and you don't know what version you have...

    Open AirPort Utility

    Click the AirPort Utility menu in the upper left corner of the screen

    Click on about AirPort Utility

    Report on the version number you see here

    You have an iPhone or a handy iPad that could be used to implement the 4th Gen airport if the problems continue with the help of your Mac?

  • Question of implementation in the form of simple output file

    First off I did preface this by saying that I'm not a very good user of LabVIEW.  What I learned that I have myself taught just glancing vi control instrument.  Well, I'm taking a number of readings of my Agilient 34972 A switch.  I can send the command convert the returned string and play in a table.  The question I have is when I try to write this table to a file.  If I take the table directly as it comes to the loop that converts a string into an array, I end up with a file that looks like this:

    TimeData

    025.8

    124.3

    226.1

    323.9

    025,7

    124.4

    225.9

    324,1

    And so on.  Not at all what I want.  I understand what is happening but don't really know how to solve this problem, except that as I did in my program below, but this is very tedious, especially if I want to expand to 15 or 20 channels.  In this method I break the table flat recombine it and then write it to file and I find myself with a file of type:

    TimeData0Data1Data2Data3

    0.2525.824.326.123.9

    0.525.724.425.924.1

    And so on.  My question is that I'm sure that there is a simpler way to do exactly that, but I can't seem to understand.  Any suggestions would be great thank you.

    Out of curiosity, what is the problem with the recording just response of the instrument directly in the text file?  Seeing that it is delimited by commas, I could save the data in a *.csv (values separated command file).  Then same Excel read nicely.

    Something like that is what I consider.

  • How many licenses can I have with the individual Plan, and how many licenses can I have with work Plan?

    I want to buy the creative cloud, but I need to know how many licenses have individually and how many licenses the work Plan.

    Currently, the individual all the app plan $49.99 / month and the teams for a single user plan is $69.99 / month.

    You a refer to:individual, teams and plans and awards:

    If you go to this page and scroll down to the bottom, there is a comparative table which may help to clarify:

    Creative cloud for teams. Adobe Creative Cloud for businesses

    These can also be useful:

    FAQ: What is the difference between an annual plan and monthly plan?

    FAQ: What plans are available for creative cloud?

    FAQ: How can I find what is included in each Plan creative cloud?

    FAQ: How Creative Cloud storage do with my plan?

    FAQ: Where can I get information on creative cloud for the enterprise, education, Government and teams?

  • I just want to know if it is possible to go from flash to indesign with the same plan. I don't want to cancel, but I need to access a different program now.

    I'm no longer using Adobe Flash, but I now need access to the Indesign program. Is it possible to change, but keep the same plan that I currently use. I don't want to cancel and pay the fee if I have just produced.

    As I said, I doubt that they will allow this reasoning to stand as a reason for switching plans.  They don't base their plans on the temporary needs of the population.  They are more likely to encourage them to enroll in the student plan that includes applications... or possibly their more expensive monthly plan whatever, arguing your point here is not to matter as the decision rests with anyone contact you support.

  • How many licenses are delivered with the individual plan?

    How many computers can I install the software on with the individual unlimited plan?

    You have 2 activations.

    Mylenium

  • Questions about synchronize with the database.

    Hi experts,

    With the help of Jdev11.1.1.5.0 - adfbc-oracledb10g

    I got quite stupid question.

    but I need to ask this question here.

    while I give make a right-click to eo synchronize with the database. EO get the newly created field.

    I had a vo is dependent on the OS. the vo not update how can get the field. ?

    Someone can help me.

    Published by: ADF7 on March 12, 2012 21:02

    ADF7,

    You don't the you in your VO up to you to add attributes manually. VO is supposed to be some specific use cases and so in general do not need all of the underlying fields of the EO. You can add them by going to the VO and the shuttle of new fields in the attributes list.

    John

  • Another JS question please - identification of the paragraphs in length

    Hi all

    Based on all the new things I discovered yesterday that I want to inspire a code snippets and use it to identify all paragraphs up to 10 words in length and apply a paragraph style "topic". I start with

    app.findGrepPreferences.findWhat = "^.» + $» ;
    Ditto = app.activeDocument.findGrep ();

    so Ditto contains all the paragraphs in history and then I want to say something like

    myHeadings = these paragraphs with myResult.length between 1 and 10

    but I don't know how. After that, I think I know how to apply a style to the paragraphs myHeadings (head of myHeadings.appliedParagraphStyle = "A";).

    This is a job for a loop for to browse the content of same? But if this is what I am a loop and how do I get the result of this in myHeadings?

    Thank you

    Iain

    > app.findGrepPreferences.findWhat = "^.» + $» ;

    > Ditto = app.activeDocument.findGrep ();

    > so Ditto contains all the paragraphs in history

    This isn't a very effective approach. Also, it will get you all the paragraphsi in the Document, not the story.

    In addition, if you do not set preferences, it will remember the preferences of what ran before, who could do almost anything... you must always initialize them first:

    app.findGrepPreferences = NothingEnum.nothing;
    app.changeGrepPreferences = NothingEnum.nothing;
    

    In any case, effective way to get all paragraphs is to use:

    myResult = app.activeDocument.stories.everyItem().
                   paragraphs.everyItem().getElements();
    

    However, which uses the syntax of. everyItem() which is confusing understand...

    > myHeadings = these paragraphs with myResult.length between 1 and 10

    > but I don't know how.

    > Is this a job for a loop for to browse the content of same? But if this is what I am a loop and how do I get the result of this in myHeadings?

    Yes, you are on the right track. Simply declare a loop variable, the length of myResult.words.length control and wrap above all from 0 to Ditto (minus 1, because you start counting at zero; if there are 2 items in same, myResult.length is 2, but Idem [0] and Ditto [1] will be valid and Ditto [2] will not).

    Note that myResult.length is the length of same - the number of results - the number of paragraphs in the document. This isn't what you want to check. If you want to check the number of words (rather than the number of characters or something else), you will need to watch [someNumber] Idem. words.length. here I paste into a variable, to avoid having to write two times:

    var i, wordCount;
    for (i=0; i= 1) && (wordCount <= 10)) {
        myResult[i].appliedParagraphStyle = "A head";
      }
    }
    
  • Problem with the paragraph in CS3 mac Styles

    I was wondering if anyone can help. I have a number of documents that have been created with paragraph styles by using a font that has disappeared from my machine. Now when I open my documents they look right. I changed the paragraph style in one of the documents to use a different font and now it looks fine, but all my other documents look bad. Is there anyway to set all my documents to use the updated paragraph style or will I have to change them all manually?

    There are several ways to go with this. We need to put all the files in a book,

    temporarily and being one with the correct as style definition the value the

    source, and then synchronize the paragraph styles. This will change all THE styles

    with the same names across all documents and add styles

    are present in the source, but not in any other files, so it's a bit

    risky, especially if any models are based on or [base

    Paragraph] itself is used in one of the files, and it is not already defined

    exactly the same thing in all the files.

    You can also open any file and go to the paragraph Styles Panel menu and

    Choose the command charger load styles, and then select the style you want to load, and how

    dealing with conflict (incoming use), which will give you more control over what

    is happening.

    Or whenever you open a file and get the warning of missing fonts, you can go

    Find font and select the missing font, then pcik your substitute, check the

    redefine the styles box, and then click all change. It would be probably the best

    choice since it is not the style names to make the correct changes.

  • Question about report with the format "Date."

    Hello friends! I want to make a line chart with a measure on the columns and type 'date' Format (MM/dd) data on lines and my report is invited with the type 'date '. In my dashboard page, I have a prompt with the Date and the operator is "BETWEEN".

    For example if I choose in my line of the first date: 01/01/2009 and the second date: 01/10/2009 in my chart, I see the results between these dates. But my question is... I see the same date last year? I mean if I choose the 01/01/2009 - 10/01/2009 I see this line and another line with 01/01/2008-01/10/2008. Is this possible?

    Because in my guest I can't type a variable presentation because date type is not taken care of...


    Thank you very much!!

    Let's say you have fresh measure
    then in your SPR you create logical column with the AGO formula (costs, TimeDim.YearLevel, 1)-Let's call him ' py 'measure.
    This will be your column YAGO...

    now in your report - you drop date, measure and measure columns py... it should work as long as you have the right size of set up time

Maybe you are looking for

  • CG3000 DV - 2rg channels above 11?

    I have the modem/router cable above and have been very happy with it. Now, even though my position is being flooded with other routers. I was wondering if there was a way to force or with the software, the channels above 11. My application of wifi An

  • Satellite Pro S300: modem 3G & Toshiba Wireless Manager Update

    I received through Toshiba Tempro an update for my Toshiba Satellite Pro S300 (W7 32-bit) for a 3 G modem and Toshiba Wireless Manager.After the State Manager is installed, there is not such a modem. This laptos has a build-in modem, where can I put

  • HP p1102: can not install software on windows 10

    Hello guys! I used to connect my printer (hp p1102) to windows7, now I bought the new laptop and I can not install its software on windows 10. It gives me error is 0 x 80131500 and it cannot recognize my printer during installation, but it is in the

  • 14 - r113TU cell: abnormal buzz

    I recently bought a new computer hp laptop with the computer product number laptop 14-r113TU. And I hear a slight hum of the fan. It seems that the sound is picturesque fan something during rotation. But its very sweet sound. I hear that when I keep

  • Winsock error: when you try to update of Delta Force: Black Hawk Down for my PC

    When I try to update of Delta Force: Black Hawk Down on my PC, I get the following error: WS_ERR:Unknown Winsock error When I try to play in multiplayer mode, I get an error that says this page cannot be displayed. I tried to uninstall the game twice