Fulltext CONTAINSTABLE predicate push down - wrong statistics

Hi, 
We use the CONTAINSTABLE function to search the fulltext index in our production environment. 
We use the strategy, described in this article http://support.microsoft.com/kb/2549443
This is part of our query. The query is mixed with relational and fulltext predicates: 
df.DOCUMENT_TEXTS_TMP doctext ON doc.DOC_ID = doctext.DOC_ID
INNER JOIN containstable(df.DOCUMENT_TEXTS_TMP, ABOUT, @p_about) r ON doctext.ID = r.[KEY] AND r.[KEY] BETWEEN @p_From_ID AND @p_To_ID
This is part  of the SCHEMA: 
CREATE TABLE [df].[DOCUMENT_TEXTS_TMP](
[DOC_ID] [bigint] NOT NULL,
[ABOUT] [nvarchar](1000) NOT NULL,
[REMARK] [nvarchar](4000) NULL,
[REGISTRATION_DATE] [datetime] NULL,
[ID] [bigint] NOT NULL)
We encode the REGISTRATION_DATE and the DOC_ID into the ID column with this function: 
DATEDIFF(DAY, '19000101', REGISTRATION_DATE]) * 100000000000000 + DOC_ID
We use the ID column as a key for the full text index.
When we search with the predicate "AND r.[KEY] BETWEEN @p_From_ID AND @p_To_ID" the estimated number of rows returned from the containstable function is roughly 10 percent of the total number of rows without that predicate. This is true ONLY
when we use wildcard for the @p_about parameter: like this - @p_about = N'"Jhon*"'. When we remove the wildcard ('"Jhon"') then the estimations are ok ! 
When we search without the "AND r.[KEY] BETWEEN @p_From_ID AND @p_To_ID" predicate, then the estimated number of rows returned from the containstable function are very good independently from the wildcard in the @p_about param.
We reached the 10% number with many samples. It is not exact percent, but it is roughly there.
Because of this, there are situations in which wrong query plans are generated and the performance is very poor.
Is there a specific reason for this behaviour or maybe we do something wrong ?
Thank you in advance,
Atanas

this is the first I have heard of that parameter...
TASD:
SQL> show
parameter optimizer_secure
NAME                               
TYPE    VALUE
optimizer_secure_view_merging                 boolean      TRUE
So what affect does it have on what I'm seeing???
Thanks so much for the help!
Cory

Similar Messages

  • Predicate push down in 10.2.0.3 but not in 11.1.0.7

    In the SQL and PL/SQL forum, there was an interesting question on why a predicate isn't pushed down in an 11.1.0.7 database while 10.2.0.3 did push the predicate, here: Same query works OK on 10.2.0.3 and not OK on 11.1.0.7-please help
    The last post contains 10053 trace output. Maybe any of the performance experts in this forum has an explanation?
    Regards,
    Rob.

    SQL> ALTER TABLE LOGIN ADD (
      2  CONSTRAINT FK_LOGIN_MPI
      3  FOREIGN KEY (MPID)
      4  REFERENCES PERSON_ID (MPID));
    REFERENCES PERSON_ID (MPID))
    ERROR at line 4:
    ORA-02270: no matching unique or primary key for this column-list
    SQL> Select
      2  rn,
      3  mpid,
      4  first,
      5  middle,
      6  last,
      7  account_status,
      8  username,
      9  last_login,
    10  date_added,
    11  degree,
    12  ssn
    13  from
    14  (
    15  Select
    16  rownum as rn,
    17  mpid,
    18  first,
    19  middle,
    20  last,
    21  account_status,
    22  username,
    23  last_login,
    24  date_added,
    25  degree,
    26  ssn
    27  from
    28  (
    29  SELECT distinct
    30  p.mpid as mpid,
    31  UPPER(name_first) as first,
    32  UPPER(name_middle_initial) as middle,
    33  UPPER(name_last) as last,
    34  l.account_status,
    35  username,
    36  TO_CHAR(last_login, 'DD-Mon-YYYY') as last_login,
    37  TO_CHAR(date_added, 'DD-Mon-YYYY') as date_Added,
    38  degree,
    39  ssn
    40  FROM
    41  PERSON_ID p,
    42  login l
    43  WHERE
    44  p.mpid=l.mpid AND UPPER(p.name_last) LIKE '%SMITH%'
    45  ORDER BY
    46  name_last ASC
    47  )
    48  )
    49  where
    50  rn >= 1 and rn <= 20;
    name_last ASC
    ERROR at line 46:
    ORA-01791: not a SELECTed expression
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.1.0.5.0 - 64bi
    PL/SQL Release 10.1.0.5.0 - Production
    CORE    10.1.0.5.0      Production
    TNS for Solaris: Version 10.1.0.5.0 - Production
    NLSRTL Version 10.1.0.5.0 - Productionbon, je n'ai pas de 10.1.0.4 windows, mais je doute que ça fasse vraiment la différence
    donne moi l'output dans sqlplus

  • Remote desktop 8.0.14 (and prior) full screen RDweb session, screen pushed down by Mac Menu bar, mouse pointer on wrong position

    Hi
    On Mac OS X 10.10 Yosemite, there is a clear bug on the Microsoft Remote desktop app when
    a) remoting into a Windows server that is set to display full screen
    b) when you are logging in using a RDweb server aka RDS 2012.
    After logging in to the remote server, the full screen representation of the server desktop has the following issues:
    - The Mac Launchpad is still visible over the Windows desktop, making that part of the Windows desktop impossible to reach.
    - The published screen is pushed down about 15 pixels. It is pushed down by the Mac's menu that also remains visible.
    When I directly remote into the same server using traditional direct RDP (Not via the RDweb, gateway setup) the screen positions correctly. 
    I guess: Somehow the Remote desktop app  (8.0.14) does not seem to get the message from the server that this is a full screen session? Is there some information that the connection Broker or Gateway is not passing allong to
    the client? 
    I have replicated this many times. It is the same whether I connect to a 2012 server or to a 2008 server.
    Bart

    Hi,
    For a try you can use URI scheme for the specified desktop screen or full screen and check the result. You can refer the following article for information.
    Remote Desktop Client URI Scheme Support
    https://technet.microsoft.com/en-us/library/dn690096.aspx
    Apart if you have RD Gateway setup then you can try the option for RD Gateway to uncheck “Bypass RD Gateway for Local address” and verify result.
    Hope it helps!
    Thanks.
    Dharmesh Solanki
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • Why is Site Slices pushed down when i add text?

    how come when i upload my site and when i add too much words
    it pulls the bottom away from the original layout. I can only fill
    the box half way of words and when i pass that it will move it
    down. Why does it do that?

    "camerapro" <[email protected]> wrote in
    message
    news:enf6cf$39t$[email protected]..
    > Revised Promblem. I have my site uplaoed to web and it
    is all sliced but
    > bottom
    > slice is pushed down. Everytime i go past a certain
    point with the text it
    > pushs down the bottom slice. What am i doing wrong.
    >
    Probably because you may have used a graphics program to
    write your html
    code for you - did you? Or did you use layout mode in
    Dreamweaver? I can't
    see a link to the problem page... so I'm assuming. What
    happens when you
    have a rigid table layout for example, is that whenever you
    add text to a
    cell, that cell expands and the adjoining cells will push
    your original
    design out the window.... this may help:
    http://apptools.com/rants/spans.php
    You may need to look at using nested
    tables.......
    Nadia
    Adobe® Community Expert : Dreamweaver
    Tutorials |SEO |Templates
    http://www.DreamweaverResources.com
    http://www.perrelink.com.au
    CSS Tutorials for Dreamweaver
    http://www.adobe.com/devnet/dreamweaver/css.html

  • Query cannot be pushed down - error

    Hi,
    I am using WSAD5 and Oracle10g and trying to generate RMIC
    for a CMP entity bean. Using EJB QL I created a method:
    findProductsByAge(int age) defined with:
    select object(o) from Product o where o.productAge = ?1
    The corresponding column AGE in the database is NUMBER(3).
    On the Product bean the field productAge is Integer.
    When I try to generate deploy code I get the error:
    Query cannot be pushed down
    I also defined a query findProductsByType(String type) with:
    select object(o) from Product o where o.productType = ?1
    and this one is working fine.
    Can anyone help?
    Thanks,
    Igor

    Dear All,
    I have written a EJB QL for a CMP as
    On trying to generate RMIC code for the same, I am
    getting the following error message -
    Error generating findByBasePrice(double) query
    for bean ContainerManaged(Abstract schema
    name=ProductTableSchema). Error=query cannot be
    pushed down
    The name of CMP bean is ContainerManaged. And,
    the name of method is findByBasePrice(double).
    The query is -
    SELECT DISTINCT OBJECT(p) FROM ProductTableSchema
    p WHERE p.basePrice = ?1
    The XML tag for the aforementioned query is -
    <query>
    <description></description>
    <query-method>
    <method-name>findByBasePrice</method-name>
    <method-params>
    <method-param>double</method-param>
    </method-params>
    </query-method>
    <ejb-ql>SELECT DISTINCT OBJECT(p) FROM
    ProductTableSchema p WHERE p.basePrice = ?1</ejb-ql>
    </query>Where am I going wrong?
    Thanks in advance.
    Regards,
    Ashish A.Ashish, have you solved the problem? I am having the same problem but I use int instead of double as a parameter to the method. In the
    database the corresponding column is of NUMBER(3) data type.

  • 3-column css "push down" problem

    I'm using a 3-column nav css design for my site (take a look
    at rjkg.com/GS.html), but the center and right columns are being
    pushed down in IE. Here's the css (navbar is left, headlines is
    right, and content is center):
    #navBar{
    float: left;
    width: 20%;
    margin: 0px;
    padding: 0px;
    background-color: #ffddbb;
    border-right: 1px solid #cccccc;
    border-bottom: 1px solid #cccccc;
    #headlines{
    float:right;
    width: 20%;
    border-left: 1px solid #cccccc;
    border-bottom: 1px solid #cccccc;
    padding-right: 10px;
    background-color: #ffddbb;
    background: #ffddbb;
    #content{
    float: left;
    width: 499px;
    margin-top: 0px;
    margin-right: 0px;
    margin-left: 0px;
    What do I do to make it showcorrectly in IE?
    Also, in Firefox, the center column isn't actually centered
    between the two sidebars, but I'd like it to be. Any clues?
    Thanks in advance from this newbie!
    R.

    > rjkg.com/GS.html), but the center and right columns are
    being pushed
    > down in
    > IE. Here's the css (navbar is left, headlines is right,
    and content is
    > center):
    >
    > #navBar{
    > float: left;
    > width: 20%;
    > margin: 0px;
    > padding: 0px;
    > background-color: #ffddbb;
    > border-right: 1px solid #cccccc;
    > border-bottom: 1px solid #cccccc;
    > }
    >
    > #headlines{
    > float:right;
    > width: 20%;
    > border-left: 1px solid #cccccc;
    > border-bottom: 1px solid #cccccc;
    > padding-right: 10px;
    > background-color: #ffddbb;
    > background: #ffddbb;
    > }
    >
    > #content{
    > float: left;
    > width: 499px;
    > margin-top: 0px;
    > margin-right: 0px;
    > margin-left: 0px;
    > }
    >
    > What do I do to make it showcorrectly in IE?
    >
    > Also, in Firefox, the center column isn't actually
    centered between
    > the two
    > sidebars, but I'd like it to be. Any clues?
    20% + 20% + 499px = ?
    You can't mix measures like that. Try replacing 499 with 60%.
    Your float
    will now drop in all browsers. Why?
    20% + 20% + 60% = 100%
    But the borders and padding you've assigned are added to the
    width,
    resulting in another mathematical improbablility. The easiest
    way to fix
    that is the remove the padding and borders from the main
    boxes and then
    nest content boxes inside the main boxes. Assign your borders
    and
    padding to those nested elements.
    Al Sparber - PVII
    http://www.projectseven.com
    Extending Dreamweaver - Nav Systems | Galleries | Widgets
    Authors: "42nd Street: Mastering the Art of CSS Design"

  • My phone wont reset with the both buttons pushed down method.. anyone knows anything else? please help!

    my iphone 4 is stuck in the spinning wheel mode, ive tried reseting it with both buttons pushed down and it wont reset! anyone knows some other way to do it? please let me know! thanks

    When you push both buttons (home and on/off), you need to hold them down together for 10-12 seconds till the Apple logo appears.

  • In ODSI 10gR3 fn:string-length() not pushing down to db (SR: 7714015.993)

    Under ALDSP 2.5, the following XQuery...
    where string-length($medacf) = 0 or $medacf = $acf/column_name
    ...used to generate this SQL:
    where ((? = 0) OR (? = t1."COLUMN_NAME"))
    However, under ODSI 10gR3, the where clause is missing. Here's the query plan:
    <?xml version="1.0"?>
    <FLWOR>
    <return>
    <elementConstructor name="UserGroup" tip="{ld:PhysicalLayer/UserProfile/UserGroup}UserGroup">
    <elementConstructor field="(0)" name="UserID" from="$f7815">
    </elementConstructor>
    <elementConstructor field="(1)" name="GroupID" from="$f7815">
    </elementConstructor>
    </elementConstructor>
    </return>
    <where sqlstop="Unable to generate SQL for XQuery expression: Cannot generate SQL for the function {http://www.bea.com/xquery/xquery-operators}integer-equal with parameters (Parameter,INTEGER), (Constant,INTEGER). There is no equivalent SQL for this function in general or with these particular parameter kinds/types. ">
    <operator ns="op" name="boolean-or" tip="{http://www.w3.org/2004/07/xpath-operators}boolean-or">
    <EQ sqlstop="Cannot generate SQL for the function {http://www.bea.com/xquery/xquery-operators}integer-equal with parameters (Parameter,INTEGER), (Constant,INTEGER). There is no equivalent SQL for this function in general or with these particular parameter kinds/types. " tip="{http://www.bea.com/xquery/xquery-operators}integer-equal">
    <operator ns="fn" name="string-length" tip="{http://www.w3.org/2004/07/xpath-functions}string-length">
    <variable name="__fparam0" kind="EXTERNAL">
    </variable>
    </operator>
    <constant>
    <![CDATA[[integer 0]]]>
    </constant>
    </EQ>
    <EQ tip="{http://www.bea.com/xquery/xquery-operators}string-equal">
    <variable name="__fparam0" kind="EXTERNAL">
    </variable>
    <variable name="(2)" from="$f7815" kind="extracted">
    </variable>
    </EQ>
    </operator>
    </where>
    <for name="$f7815">
    <source ns="fn-bea" name="UsrProfDataSource" sqlwarning="Generated SQL query does not have a WHERE clause. This may cause the query to take longer to finish and use excessive memory resources." kind="relational" tip="UsrProfDataSource">
    <![CDATA[SELECT UPPER(t1."USER_ID") AS c1, t1."GRP_ID" AS c2, t1."USER_ID" AS c3
    FROM "USRPROF"."USER_GRP" t1]]>
    </source>
    </for>
    </FLWOR>

    We have found that in ODSI 10gR3, the code pattern below is not pushed down if $logicalExpression is an expression that compares two atomic values and one of the values is a constant (used to work in ALDSP 2.5):
    where $logicalExpression or $table/column = $input
    Sample code that is not pushed down as expected:
    where fn:string-length($accountNumber) _<= 0_ or $account/ACCT_NUM = $accountNumber
    where fn:empty($accountNumber) or $accountNumber _= ''_ or $account/ACCT_NUM = $accountNumber
    where fn:empty($clientId) or $clientId _= 0_ or $account/CLIENT_ID = $clientId
    where fn:empty($effectiveDate) or $effectiveDate _= xs:date('0001-01-01')_ or $account/ACCT_EFF_DT = $effectiveDate
    We have also found that a workaround is to tweak the code and replace $logicalExpression with something that can be pushed down and functionally equivalent (using fn:not, fn-bea:fence, fn:exactly-one, etc.).
    Code that works:
    where fn:not(fn:string-length($accountNumber) > 0) or $account/ACCT_NUM = $accountNumber
    where fn-bea:fence(fn:string-length($accountNumber) <= 0) or $account/ACCT_NUM = $accountNumber
    where fn:exactly-one(fn:string-length($accountNumber) <= 0) or $account/ACCT_NUM = $accountNumber
    After examining the query plans, it appears to me (please correct me if any of these is not true):
    - Comparators for atomic types ({http://www.bea.com/xquery/xquery-operators} integer-less-than-or-equal, string-equal, date-equal, etc.) are not pushed down if they are used to compare anything with a constant
    - An "or" operation ({http://www.w3.org/2004/07/xpath-operators} boolean-or) is not pushed down if any of its operands cannot be pushed down
    - fn:not, fn-bea:fence, and fn:exactly-one can be pushed down even if their operand cannot be pushed down
    So the question is, why comparators are not pushed down when constants are involved? Is this a bug?
    Thanks!
    -r.

  • Formula Aggregation not pushed down to HANA DB

    Hi SAP Experts,
    We are creating a query in Query Designer. The query contains a formula with exception aggregate on material. See attachment 1 for details.
    When I execute and explain the query in RSRT, it runs for more than 1 min and the explain also says it has not been pushed down to HANA DB
    In RSRT query properties, we've tried each 'Operation in BWA/HANA' parameters, but the result is same.
    We are on BW7.4 SP7. HANA DB version is 1.00.70.00.386119
    According to SAP document, formula exception aggregate should be pushed down to HANA DB.
    Can any SAP expert advise if there's any specific setting you need to make to enable this? Thanks.
    Regards,
    Aaron

    Also would want to know if there are issues with the latest rev. SP7 w.r.t alerts and hdbstatisticsserver service under Landscape?
    I have observed the hdbstatisticsserver (and daemon.ini) doesnt come up on its own after db instance is restarted.
    FYI: I have HANA Instance on Linux VM (sandbox). 

  • Where clause one query not being pushed down

    I am having a problem where I cannot get a certain "optional" parameter to be pushed down to a query. The parameter gets applied in memory after the result set is returned but not pushed down to the DB. The function is as follows:
    declare function getFoo($key as xs:string, $optinalInput as xs:string*) as element(b:bar)*
    for $foo in f:getFoo()
    where $key = $foo/key
    where not(exists($optinalInput)) or $foo/optional = $optinalInput<- does not get pushed down to the query
    return $foo
    If I make optinalInput an xs:string instead of xs:string * and the optional parameter will get pushed to the query. The problem is for this optional parameter I could get anywhere from 0-50 in the sequence. Seems like when the parameter is a sequence it doesn't get applied to the query. Is there any way around this?

    Mike,
    I understand the difference between * and ? and I was one of the people working on the "string-length not getting pushed" problem so I am very familiar with it. I tried you solution that you mentioned below and it still did not push the where clause to the query. I know I could achieve this with an ad-hoc query but I wanted to do a pure xquery implementation of this component because of the benefits it could have when interacting with other components in our ODSI project...such as SQL joining and potentially pushing additional where clause down from components that call this component. The only way I did get this to kind of work is to do this:
    return
    for $o in $optinalInput
    for $foo in f:getFoo()
    where $key = $foo/key
    where $o = $foo/optional
    return
    $foo
    for $count in 1
    where not(exists($optinalInput))
    for $foo in f:getFoo()
    where $key = $foo/key
    return
    $foo
    By putting the optional parameter into a FOR statement above the table call it guarantees that at least one will exists and that's why the optional parameter gets pushed properly to the DB with a parameterized query. The problem with this is that even though a parameterized query gets pushed it will call the SQL statement multiple times!...not good.
    Another solution that was suggested to me would be to create the number of sequences for each item in the sequence and treat each item as it's own. For example if you know that the schema limits the sequence from 0..50 then you could make 50 items and 50 where clauses....probably not an optimal solution either but it would achieve properly pushing the where clause tot he DB.
    For now I am satisfied with this optional parameter not being pushed to the DB because the performance was still good but it would be nice if there was a maintainable pure xquery solution to this problem.
    Thanks for the help it's always appreciated!
    Mike

  • Usage of BODS Functions (NVL,DECODE...) are stopping the FULL PUSH-DOWN

    Hi,
    It seems that the usage of BODS Functions like NVL and DECODE are leading to the partial PUSH-DOWN to the database.
    Is there any way to achive to the FULL PUSH DOWN (INSERT INTO DBTABLENAME)?
    Regards,
    Sudhakar

    Hello
    The optimiser determines if the whole dataflow can be pushed-down.  NVL and DECODE can be pushed-down to most databases, so its something to do with how you've built the dataflow.
    Things that stop full push-down
    1 - custom functions
    2 - complex statements
    3 - datatype conversions
    3 - complex dataflows with many transforms
    4 - some specific tranforms (DQ, pivot,etc.)
    With a bit of trial and error, you should be able to figure out which is stopping yours.
    Michael

  • Div's being pushed down in Safari

    Hi guys,
    I've built a website for a client. For some unknown reason the footer content gets pushed down on the friends page in Safari and IE - all of the other pages are fine though.
    Here's a link to the site
    Can anyone see why this could be happening - in FF everything is fine though.
    Thank you!
    SM

    On Win 7, Safari, IE9 and Firefox, all looks the same. I am not seeing anything different.
    Jim

  • TOC tab pushing down master slide background

    Why is this happening? It only occurs on three new slides and it pushes down the master slide (background only, not content)

    I am using Captivate 7. Here are two screen shots; one that is displayed correctly and one that pushes the master slide down, but leaves the content in place.

  • Looking for a algorithm called push down atonima??

    I am trying to get an example of a search algorithm called a
    push down atomina
    I think that is the name but not sure.
    thanks,
    steve

    Think you'll be lucky to find anything in the forum on push down automata. Do a search on google, perhaps with the keyword "parser" or "grammer checker" thrown in. There may well be whole books devoted to it!

  • How to package ActiveX controls for printing to push down to clients

    We have installed Crystal Server 2008 in an environment where the client machines are "locked down" ( they do not have local admin rights on their machines ). We want to create a package that will be pushed down to the client machine, containing the components needed to print using the ActiveX control. How can we build this package?

    See my discussion on the following thread:
    How deploy printcontrol.cab to all clients?
    Ludek

Maybe you are looking for