Good application of a filter of 50 Hz

Hello

I need to apply a filter of 50 Hz to an acquisition of signals DAQ (noise for testing).

When I apply the filter, the resulting signal has enormous oscillations in the first part of the signal acquired (as see you in "Filter output.png"), after these oscillations, the signal becomes filtered as it should.

I tried to change the sampling frequency, the frequency of signal acquisition and all other settings, but I can't get rid of these oscillations.

What Miss me?

In "Diagram.png", you see the pattern of the filter.

The signal is acquired at 10 k rates and includes 30 k points.

I have some experience with Labview, but I've never used its filters.

Thanks for the help

Your image resolution is a bit low to be sure, but it seems that you have a significant lag in the data.  A mismatch can lead the transient response of the filter. With a filter bandwidth, which can produce an oscillating reaction.

With your entry of noise you get very little energy in the band stop filter so it can be difficult to see the effect. When I simulate your signal with offset of the hard shoulder is almost impossible to detect. The noise in each tray is approximately 60 dB below the offset and the stopband attenuation is about the same.  Without the offset the stopband is detectable (visually on a graph) about a quarter of the time. With 300000 samples, it is almost always visible with or without the offset.  See the image below.

This is the spectrum of random noise with shift amplitude of 5 times and 300000 samples.

Usually interpreted restrictively the frequency response of a filter, more transient response.

Lynn

Tags: NI Software

Similar Questions

  • The Application of the filter node of event using the mouse down?

    Hello

    I have a question regarding the application of the filter nodes of the Mods and PlatMods event.

    With respect to the event "Button" filter node, I can change the response when I click on the botton, either for a right click or left click.

    The filter node throwing event is more common to use, it can provide the opportunity to reject the action of the set button.

    But now I can't realize how to use the node of the Mods and PlatMods event filter.

    I change the value of the double click event filter node, then what?

    Could someone give an idea or a suggestion? Example or scenario is preferred, thank you very much.

    There are several reasons why you want to change the action with the filter node. For example if you also have a key value changed event, you could turn a right-click (that normally would be open the contextual menu) with a left click then immediately triggered the value change event.

    Similarly, you might have a change of value and double click even for a listbox control. Then, you could add a fiterling event mouse that would make a single click (normally not trigering a change in value) in a double-tap for some values, but leave in one click for other values.

  • application 2D median filter for images

    I want to use the function of median filter 1 d LabVIEW for application table 2d (image).  Vision doesn't have this feature (or I can't find not [using Vision 8.5]).  I guess I can apply the median filter 1 d through the lines, then transpose the table and apply again to the lines (really columns but now the lines because of the conversion).   Just like the use of the 1-d FFT for 2d FFT.  Is this strategy the correct?

    Thank you

    Don

    That's where - IMAQ NthOrder under treatment: Image filters.

    By default, it takes the middle number of a 3 x 3 around each pixel region, but can be set to be the biggest, smallest, or any place in between.  Also the ability to set the size of the filter, although it is a non-linear filter (so why it is not separable as you suggest) the time increases significantly.

  • Good query... filter look please

    Hello

    Collate under scenario, here I just need to filter the records that ST & ST_NEW as "Hard closed" and need to retrieve more records...

    I expect 4 documents to be retrieved on 5... but its shows me just 3 disks... can yoh remodify the filter condition to extract 4 records...

    < br >

    WITH T as
    (
    1 SELECT ID, ST "Hard closed", "archived" DOUBLE ST_NEW
    UNION ALL
    2. SELECT ID, ST 'Hard closed', ST_NEW 'Hard closed' of THE DOUBLE
    UNION ALL
    3. SELECT ID, 'Hard' ST ST_NEW 'Hard closed' of THE DOUBLE
    UNION ALL
    4. SELECT ID, 'Open', 'archived' ST_NEW OF the DOUBLE ST
    UNION ALL
    SELECT 5 ID, ST 'pen', 'Feather' ST_NEW FROM DUAL
    )
    SELECT * FROM T
    WHERE
    DECODE (ST, 'Hard Closed', ST, ST) & lt; & gt; DECODE (ST_NEW, 'Hard Closed', ST_NEW, ST_NEW)

    < here >

    Thank you...

    Published by: BluShadow on April 12, 2011 12:59
    fixed the & lt; & gt; that is a question of forum.

    Your decode statements aren't really do anything because if the value is "hard closed" or not, each provides the same value.

    You must create a difference for example

    SQL> ed
    Wrote file afiedt.buf
    
      1  WITH T as
      2  (
      3  SELECT 1 ID,'Hard Closed' ST,'Archived' ST_NEW FROM DUAL
      4  UNION ALL
      5  SELECT 2 ID,'Hard Closed' ST,'Hard Closed' ST_NEW FROM DUAL
      6  UNION ALL
      7  SELECT 3 ID,'Hard' ST,'Hard Closed' ST_NEW FROM DUAL
      8  UNION ALL
      9  SELECT 4 ID,'Open' ST,'Archived' ST_NEW FROM DUAL
     10  UNION ALL
     11  SELECT 5 ID,'pen' ST,'pen' ST_NEW FROM DUAL
     12  )
     13  SELECT * FROM T
     14  WHERE
     15* DECODE(ST,'Hard Closed',0,1) != DECODE(ST_NEW,'Hard Closed',0,-1)
    SQL> /
    
            ID ST          ST_NEW
    ---------- ----------- -----------
             1 Hard Closed Archived
             3 Hard        Hard Closed
             4 Open        Archived
             5 pen         pen
    
    SQL>
    
  • good applications for notification led

    Anyone know any apps to change the color of the led notification when a message is received?

    never mind Blink is the best iv ever seen for this app. You can choose between red, green, blue, yellow, purple and turquoise. If you cange for sms, missed phone call, low battery, memory full. It's amazing. I highley recommend this atrix users who like to mod their phone

    Link

    https://market.Android.com/details?ID=imoblife.blink&feature=search_result

  • Darkness of 8.4 (1) vpn L2L filter ASA when you specify the Protocol and port

    Hi all - I've spent many hours trying to diagnose this and have read several discussions and the Cisco docs unsuccessfully...

    Situation: two sites running Cisco ASA 5520 on 8.4 (1) with L2L IPsec on the public internet between each of them. The configuration of IPsec and associated routing works as it should and we are able to pass traffic between networks private behind each device as expected. The problem occurs when you try to block sessions using a vpn-filter group policy configuration.

    Each site has 3 private subnets that are able to communicate correctly without the vpn-filter configuration. We want to restrict access to specific protocols, hosts, and ports between each network.

    SITE A: 10.10.0.0/18, 10.10.64.0/18, 10.10.128.0/18

    SITE B: 10.20.0.0/18, 10.20.64.0/18, 10.20.128.0/18

    When we apply a filter-vpn configuration which restricted access only two guests, as follows...

    SITE A: vpn_acl_x_x_x_x list extended access permit ip host 10.20.0.1 host 10.10.0.1

    SITE b: the ip host 10.10.0.1 allowed extended access list vpn_acl_x_x_x_x host 10.20.0.1

    ... the configuration works correctly. However, when we try to lock the configuration more far and specify the protocols and ports, as follows...

    SITE A: vpn_acl_x_x_x_x list extended access permit tcp host 10.20.0.1 host 10.10.0.1 eq 22

    SITE b: vpn_acl_x_x_x_x to the list of access permit tcp host 10.10.0.1 host 10.20.0.1 eq 22

    ... and then try to establish a SSH connection between 10.10.0.1 and 10.20.0.1 or vice versa, the package is stopped on the side of the SOURCE. ..

    Mar 22 11:58:01 x.x.x.x 22 March 2011 14:34:56: % ASA-4-106103: vpn_acl_x_x_x_x of the access list refused tcp to the user "" inside-data/10.10.0.1(59112)-> outside-iptrans/10.20.0.1(22) hit - cnt 1 first success [0xd8d1c1b4, 0 x 0]

    I would really appreciate it if someone could shed some light on what is wrong with this Setup.

    SOLUTION

    The ACE must be implemented on the source and the end of the tunnel destination to facilitate this configuration.

    EXAMPLE 1: allow SSH two-way communication between hosts on each network (SITE A can connect to SITE B, SITE B can connect to SITE A)...

    SITE A:

    access-list vpn_acl_x_x_x_x extended permit tcp host 10.20.0.1 host 10.10.0.1 eq 22

    access-list vpn_acl_x_x_x_x extended permit tcp host 10.20.0.1 eq 22 host 10.10.0.1

    SITE B:

    access-list vpn_acl_x_x_x_x extended permit tcp host 10.10.0.1 host 10.20.0.1 eq 22

    access-list vpn_acl_x_x_x_x extended permit tcp host 10.10.0.1 eq 22 host 10.20.0.1

    EXAMPLE 2: allow communication one-way SSH between hosts on each network (SITE A can connect to SITE B, SITE B is unable to connect to SITE A)...

    SITE A:

    access-list vpn_acl_x_x_x_x extended permit tcp host 10.20.0.1 eq 22 host 10.10.0.1

    SITE B:

    access-list vpn_acl_x_x_x_x extended permit tcp host 10.10.0.1 host 10.20.0.1 eq 22

    Very good and thank you for this post. Please kindly marks the message as answered while others may learn from your post. I think that you have started a very good discussion on vpn-filter for tunnel L2L.

  • Display filter using at DFW unintentionally deletes rules!

    We had a nasty surprise, while the application of a filter on the distributed firewall set rule to find specific rules. When you change the rules even if you have a filter and their publication, the rules that have been filtered are removed!

    Isn't this supposed to be a display filter? Looks like a bug to me! We use NSX 6.2

    If anyone has experienced this?

    Albert

    This is a bug and is fixed in version 6.2.2

    https://KB.VMware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalID=2141155

    Dale

  • MAF: Applications deployed on iOS Simulator are not visible

    Hello

    I use Jdeveloper 12.1.3 for the implementation of the MAF on MAC device. I used to use Jdev 11.1.2.4 with Xcode 5.1.1 and jdk 1.6. Now, after the release of the CRG, I uninstalled Jdev 11.1.2.4, jdk 1.6 and installed Jdev 12.1.3 and jdk 1.7. Open examples of good applications that created new application also. But when it is deployed to the iOS Simulator, it gets deployed successfully but in the Simulator, no icons appear for applications. Pointers please.

    Thank you

    Ajay

    Get this job now, it seems I have to unlock device iPhone of the retina (4 inches). However, previously I was using 64-bit one.

    Not sure why it is not deploy open Simulator.

    Thank you

    AJ

  • PS issue filter DEPT.

    I use PS CC with El Capitan installed. I am trying to apply a filter. I go to filter and "Gallery of filters" is grayed out. I have looked everywhere and can not find the problem. Not sure whether or not the filter worked until I updated to El Capitan. I'm new to PS so I can miss a framework. I am so desperate that I even read the instructions!

    I'm including a screen so you can see what I see.

    Thanks in advance,

    Jay Amundson

    Las Vegas, NV

    Screen Shot 2015-10-03 at 3.47.58 PM.png

    Incidentally, if you want to hang on to the bit depth of the image, make the smart object layer and double-click the layer icon to open it in another window for editing.  Bring the mode bit and 8 bit in the new window, Gallery of filters will be usable.  Once finished, Ctrl (Cmd) s to save and return to your main document that will still be in 16-bit.  Don't forget that the particular layer will be compromised, then you might want to hide all areas not affected by the application of the filter.  Who is?

  • Received a filter that is assessed to a region is empty.

    Hello!

    We have migrated our hyperion 9-11 system, and we have problems with essbase. We have the two 'execution' version (in separate servers) and we noticed that when the user who has a filter in the essbase security and this user acess the cube from spreadsheet add-in on version 11, he get the warning "a filter received which is evaluates to an empty region. Filter is ignored. ". In the 9 system warning, this does not happen. I checked two databases and I saw that they are exactly the same. Why this warning happens right on the 11 system? What does that mean?

    Kind regards
    Rafael Melo - BR

    Is it 11.1.2 that you're talking about, if it is then it can be useful to have a reading of ' warning '1022004 a filter received which is evaluates to an empty region. " "Filter is ignored" [1300347.1 ID] ' on My Oracle support.

    Symptom

    In the Essbase Excel Add-In, trying to connect to a database/application and retrieve data with a user filter definition that includes MetaRead the following warning message appears:

    'Empty 1022004 attention received by a filter that is assessed to a region. Filter is ignored. »

    Cause

    The cause of this problem is not known.

    This problem has been identified as new Bug 9700270 - FALSE ALERT WHEN you SELECT AN application WHEN METADATA FILTER ANCESTORS OVERLAP

    Solution
    This problem has been fixed in version 11.1.2.1.

    Strange how the cause of the problem is unknown, but it is fixed in 11.1.2.1, how you fix something that is unknown I have ever know.

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • Problem with a filter

    I'm having a time really difficult application of the filter "Brush-> Angled Strokes strokes" to a color box, whether just a selection or a rectangular box.

    I did it once and it worked (that is, the area remains the same color and the right filter has been applied to it), but now I'm doing it with another box, whenever I have access to the Gallery of filter with the box checked, the color remains flat, even with the filter in question highlighted. I've tried everything I can think of, but it just seems like a weird bug... First time it worked, now it doesn't. Any idea what could be the cause?

    Thank you very much in advance.

    It makes sense, because the traits in angle (really one of the filters contours) smear what is already there.  A bit like dry spraying it on the paintings.  If it has only one color, then only a single color is spread out.

    Consider what it does to your flat image, above...

    -Christmas

  • APEX Bug: Creation Bug, or make the Application Builder

    In the page editing screen application Builder:

    -Click the icon of legend at top right (left of the lock icon)
    -You have the option to create a task, a bug, or comment
    -Click on a task or a Bug
    -Scroll on the pop-up screen and in a context of application they have no application or pages to choose from

    The problem disappears if you use the create menu (top-right)
    -Select this option to make or Bug
    -If you scroll on the pop-up screen in a context of application good application numbers and page are displayed.

    Martin
    -----
    http://www.talkapex.com

    Thanks Martin. It is now classified as Bug 10267913 to fix in the APEX 4.1.

    Joel

  • How to apply the filter to a specific column condition, but not to the report?

    Hello

    I'm having a problem in the application of a filter to one of the column condition.
    I have a scheme with the table around 10 dimension tables and a fact. My requirement is to provide a count on the table of facts with associated with some other columns in the dimension tables.

    Lets consider a scenario with tables as sales (Fact), region (Dimension), Year (Dimension), Type of sale (Dimension).

    Now my requirement is to highlight the fields

    City (Region) - city
    Year-
    Sales Count (dirty table) - number of all sales of the fact table
    Sales Count (dirty table) - count of all sales of the fact which type of sale table is 'Cash'

    Here, my question is how to apply the filter condition of Sales Type = 'MONEY in' only on one of the Sales Count column that comes from the fact table. I want to be ordered for the fourth column, the filter condition.

    Can someone let me know how?

    Thank you

    You must do this:

    1) click the button column fx sales. (This procedure does than on fact, not attributes.0

    2) click on the filter button.

    (3) select the size of sales from the left Type "selection list."

    (4) in the filter window, enter CASH, and click OK.

    This will create one filter on sales 'use' size 'type sales' as the filter. It willl filter only to this column.

  • I put the filter for my file flat source?

    Hi all
    Please help me with best practices of ODI.
    My source is the flat file and I want to put the filter.

    I put the filter for my file flat source? If so, please help me with best practices from the application of the filter.

    Concerning
    Suresh

    Hello

    If you try to create--> Datastore model---> filter---> Insert condition
    then it will not work for files technology. You will get "Invalid Format Description"

    But you can specify a filter in the interface.
    Just drag the columns in your flat file of data store into the canvas and then specify the filter condition.

    Thank you
    Fati

  • Bind variables in the SQL causes slow

    We have a strange problem in our PeopleSoft system that I traced to a SELECT statement using bind variables, if hardcode us them values in SQL, it runs very fast.
    but using bindings (what the application does) a problem of efficiency. I'm going to re - write the code that is based on a view of three tables joined to go against
    the base tables and I don't think I'll have a problem. However, I would like to know why the problem exists in the first place. Here is what info I have:
    Oracle version: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi

    It's the 'good' application without links:
    SELECT COUNT(*)
    FROM sysadm.PS_ERN_PROG_DESCR A
    WHERE A.ERN_PROGRAM = 'VT'
    AND A.ERNCD         = '01'
    AND EFFDT           =
      (SELECT MAX(B.EFFDT)
      FROM sysadm.PS_ERN_PROG_DESCR B
      WHERE B.ERN_PROGRAM = 'VT'
      AND B.EFFDT        <= TO_DATE('2009-10-10','YYYY-MM-DD')
      );
    And the 'good' explains the plan:
     Plan hash value: 3344976101
    
    -------------------------------------------------------------------------------------------------------------
    | Id  | Operation                              | Name               | Rows  | Bytes | Cost (%CPU)| Time     |
    -------------------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT                       |                    |     1 |    33 |    58  (23)| 00:00:01 |
    |   1 |  SORT AGGREGATE                        |                    |     1 |    33 |            |          |
    |   2 |   NESTED LOOPS                         |                    |     1 |    33 |     3   (0)| 00:00:01 |
    |   3 |    NESTED LOOPS                        |                    |     1 |    22 |     2   (0)| 00:00:01 |
    |*  4 |     INDEX UNIQUE SCAN                  | PS_ERN_PROGRAM_DEF |     1 |    12 |     1   (0)| 00:00:01 |
    |   5 |      SORT AGGREGATE                    |                    |     1 |     9 |            |          |
    |   6 |       VIEW                             |                    |    23 |   207 |    51  (26)| 00:00:01 |
    |*  7 |        FILTER                          |                    |       |       |            |          |
    |   8 |         SORT GROUP BY                  |                    |    23 |  1748 |    51  (26)| 00:00:01 |
    |*  9 |          HASH JOIN                     |                    |  2995 |   222K|    49  (23)| 00:00:01 |
    |* 10 |           TABLE ACCESS FULL            | PS_EARNINGS_TBL    |  1913 | 24869 |    15   (7)| 00:00:01 |
    |* 11 |           HASH JOIN                    |                    | 13621 |   838K|    30  (20)| 00:00:01 |
    |  12 |            TABLE ACCESS FULL           | PS_EARNINGS_TBL    |  1913 | 42086 |    14   (0)| 00:00:01 |
    |* 13 |            HASH JOIN                   |                    |  3097 |   124K|    14  (29)| 00:00:01 |
    |* 14 |             TABLE ACCESS BY INDEX ROWID| PS_ERN_PROGRAM_TBL |     9 |   207 |     2   (0)| 00:00:01 |
    |* 15 |              INDEX RANGE SCAN          | PS_ERN_PROGRAM_TBL |    18 |       |     1   (0)| 00:00:01 |
    |* 16 |             TABLE ACCESS FULL          | PS_ERN_PROGRAM_DEF | 12035 |   211K|    10  (20)| 00:00:01 |
    |* 17 |     INDEX RANGE SCAN                   | PS_EARNINGS_TBL    |     1 |    10 |     1   (0)| 00:00:01 |
    |  18 |      SORT AGGREGATE                    |                    |     1 |    10 |            |          |
    |* 19 |       INDEX RANGE SCAN                 | PS_EARNINGS_TBL    |     1 |    10 |     2   (0)| 00:00:01 |
    |* 20 |    TABLE ACCESS BY INDEX ROWID         | PS_ERN_PROGRAM_TBL |     1 |    11 |     1   (0)| 00:00:01 |
    |* 21 |     INDEX UNIQUE SCAN                  | PS_ERN_PROGRAM_TBL |     1 |       |     0   (0)| 00:00:01 |
    -------------------------------------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
       4 - access("A"."ERN_PROGRAM"='VT' AND "A"."EFFDT"= (SELECT MAX("$vm_col_2") FROM  (SELECT /*+ */
                  "EFFDT" "$vm_col_1","A"."EFFDT" "$vm_col_2" FROM SYSADM."PS_EARNINGS_TBL"
                  "C",SYSADM."PS_ERN_PROGRAM_TBL" "B",SYSADM."PS_ERN_PROGRAM_DEF" "A",SYSADM."PS_EARNINGS_TBL" "D"
                  WHERE "D"."EFFDT"<="A"."EFFDT" AND "D"."ERNCD"="C"."ERNCD" AND "D"."EFFDT"<=TO_DATE(' 2009-10-10
                  00:00:00', 'syyyy-mm-dd hh24:mi:ss') AND "A"."EFFDT"="B"."EFFDT" AND
                  "A"."ERN_PROGRAM"="B"."ERN_PROGRAM" AND "A"."ERN_PROGRAM"='VT' AND "A"."EFFDT"<=TO_DATE(' 2009-10-10
                  00:00:00', 'syyyy-mm-dd hh24:mi:ss') AND "B"."EFFDT"<=TO_DATE(' 2009-10-10 00:00:00', 'syyyy-mm-dd
                  hh24:mi:ss') AND "B"."ERN_PROGRAM"='VT' AND "B"."EFF_STATUS"='A' AND "C"."ERNCD"="A"."ERNCD" GROUP
                  BY "D"."ERNCD",ROWID,ROWID,ROWID,ROWID,"A"."EFFDT","EFFDT" HAVING "EFFDT"=MAX("D"."EFFDT"))
                  "$vm_view") AND "A"."ERNCD"='01')
       7 - filter("EFFDT"=MAX("D"."EFFDT"))
       9 - access("D"."ERNCD"="C"."ERNCD")
           filter("D"."EFFDT"<="A"."EFFDT")
      10 - filter("D"."EFFDT"<=TO_DATE(' 2009-10-10 00:00:00', 'syyyy-mm-dd hh24:mi:ss'))
      11 - access("C"."ERNCD"="A"."ERNCD")
      13 - access("A"."ERN_PROGRAM"="B"."ERN_PROGRAM" AND "A"."EFFDT"="B"."EFFDT")
      14 - filter("B"."EFF_STATUS"='A')
      15 - access("B"."ERN_PROGRAM"='VT' AND "B"."EFFDT"<=TO_DATE(' 2009-10-10 00:00:00', 'syyyy-mm-dd
                  hh24:mi:ss'))
      16 - filter("A"."ERN_PROGRAM"='VT' AND "A"."EFFDT"<=TO_DATE(' 2009-10-10 00:00:00', 'syyyy-mm-dd
                  hh24:mi:ss'))
      17 - access("C"."ERNCD"='01')
           filter(SYS_OP_UNDESCEND(SYS_OP_DESCEND("EFFDT"))= (SELECT
                  MAX(SYS_OP_UNDESCEND(SYS_OP_DESCEND("EFFDT"))) FROM SYSADM."PS_EARNINGS_TBL" "D" WHERE
                  SYS_OP_DESCEND("EFFDT") IS NOT NULL AND SYS_OP_DESCEND("EFFDT")>=SYS_OP_DESCEND(:B1) AND
                  "D"."ERNCD"=:B2 AND SYS_OP_UNDESCEND(SYS_OP_DESCEND("EFFDT"))<=:B3))
      19 - access("D"."ERNCD"=:B1 AND SYS_OP_DESCEND("EFFDT")>=SYS_OP_DESCEND(:B2) AND
                  SYS_OP_DESCEND("EFFDT") IS NOT NULL)
           filter(SYS_OP_UNDESCEND(SYS_OP_DESCEND("EFFDT"))<=:B1)
      20 - filter("B"."EFF_STATUS"='A')
      21 - access("B"."ERN_PROGRAM"='VT' AND "A"."EFFDT"="B"."EFFDT")
    Here is the 'good' autotrace:
    SQL> variable ppe_date varchar2(10)
    SQL> variable erncd varchar2(3)
    SQL> exec :ppe_date := '2009-10-10'
    SQL> exec :erncd := '01'
    SQL> SELECT COUNT(*)
      2  FROM PS_ERN_PROG_DESCR A
      3  WHERE A.ERN_PROGRAM = 'VT'
      4  AND A.ERNCD         = '01'
      5  AND EFFDT           =
      6    (SELECT MAX(B.EFFDT)
      7    FROM PS_ERN_PROG_DESCR B
      8    WHERE B.ERN_PROGRAM = 'VT'
      9    AND B.EFFDT        <= TO_DATE('2009-10-10','YYYY-MM-DD')
     10    );
    
      COUNT(*)
    ----------
             1
    
    Elapsed: 00:00:01.23
    
    Execution Plan
    ----------------------------------------------------------
       0      SELECT STATEMENT Optimizer=ALL_ROWS (Cost=59 Card=1 Bytes=33)
       1    0   SORT (AGGREGATE)
       2    1     NESTED LOOPS (Cost=3 Card=1 Bytes=33)
       3    2       NESTED LOOPS (Cost=2 Card=1 Bytes=22)
       4    3         INDEX (UNIQUE SCAN) OF 'PS_ERN_PROGRAM_DEF' (INDEX (UNIQUE)) (Cost=1 Card=1 Bytes=12)
       5    4           SORT (AGGREGATE)
       6    5             VIEW (Cost=52 Card=24 Bytes=216)
       7    6               FILTER
       8    7                 SORT (GROUP BY) (Cost=52 Card=24 Bytes=1824)
       9    8                   HASH JOIN (Cost=50 Card=3177 Bytes=241452)
      10    9                     TABLE ACCESS (FULL) OF 'PS_EARNINGS_TBL' (TABLE) (Cost=15 Card=1921 Bytes=24973)
      11    9                     HASH JOIN (Cost=31 Card=14488 Bytes=912744)
      12   11                       TABLE ACCESS (FULL) OF 'PS_EARNINGS_TBL' (TABLE) (Cost=14 Card=1921 Bytes=42262)
      13   11                       HASH JOIN (Cost=15 Card=3303 Bytes=135423)
      14   13                         TABLE ACCESS (FULL) OF 'PS_ERN_PROGRAM_TBL' (TABLE) (Cost=2 Card=9 Bytes=207)
      15   13                         TABLE ACCESS (FULL) OF 'PS_ERN_PROGRAM_DEF' (TABLE) (Cost=12 Card=12856 Bytes=231408)
      16    3         INDEX (RANGE SCAN) OF 'PS_EARNINGS_TBL' (INDEX (UNIQUE)) (Cost=1 Card=1 Bytes=10)
      17   16           SORT (AGGREGATE)
      18   17             INDEX (RANGE SCAN) OF 'PS_EARNINGS_TBL' (INDEX (UNIQUE)) (Cost=2 Card=1 Bytes=10)
      19    2       TABLE ACCESS (BY INDEX ROWID) OF 'PS_ERN_PROGRAM_TBL' (TABLE) (Cost=1 Card=1 Bytes=11)
      20   19         INDEX (UNIQUE SCAN) OF 'PS_ERN_PROGRAM_TBL' (INDEX (UNIQUE)) (Cost=0 Card=1)
    
    
    
    
    
    Statistics
    ----------------------------------------------------------
              0  recursive calls
              0  db block gets
            182  consistent gets
              0  physical reads
              0  redo size
            232  bytes sent via SQL*Net to client
            278  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              1  sorts (memory)
              0  sorts (disk)
              1  rows processed
    
    SQL> spool off
    ===================================
    This is the 'bad' query using bindings:
    ===================================
    SELECT COUNT(*)
    FROM sysadm.PS_ERN_PROG_DESCR A
    WHERE A.ERN_PROGRAM = 'VT'
    AND A.ERNCD         = :erncd
    AND EFFDT           =
      (SELECT MAX(B.EFFDT)
      FROM sysadm.PS_ERN_PROG_DESCR B
      WHERE B.ERN_PROGRAM = 'VT'
      AND B.EFFDT        <= TO_DATE(:ppe_date,'YYYY-MM-DD')
      );
    The 'bad' explain plan
    explain plan succeeded.
    PLAN_TABLE_OUTPUT
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Plan hash value: 337039962
    
    --------------------------------------------------------------------------------------------------------
    | Id  | Operation                         | Name               | Rows  | Bytes | Cost (%CPU)| Time     |
    --------------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT                  |                    |     1 |    33 |    20  (25)| 00:00:01 |
    |   1 |  SORT AGGREGATE                   |                    |     1 |    33 |            |          |
    |   2 |   NESTED LOOPS                    |                    |     1 |    33 |     3   (0)| 00:00:01 |
    |   3 |    NESTED LOOPS                   |                    |     1 |    22 |     2   (0)| 00:00:01 |
    |*  4 |     INDEX UNIQUE SCAN             | PS_ERN_PROGRAM_DEF |     1 |    12 |     1   (0)| 00:00:01 |
    |   5 |      SORT AGGREGATE               |                    |     1 |    63 |            |          |
    |   6 |       NESTED LOOPS                |                    |     1 |    63 |    13  (39)| 00:00:01 |
    |   7 |        NESTED LOOPS               |                    |     1 |    52 |    12  (42)| 00:00:01 |
    |*  8 |         HASH JOIN                 |                    |     4 |   168 |    12  (42)| 00:00:01 |
    |   9 |          VIEW                     | VW_SQ_1            |    88 |  2112 |     9  (45)| 00:00:01 |
    |  10 |           SORT GROUP BY           |                    |    88 |  2728 |     9  (45)| 00:00:01 |
    |  11 |            MERGE JOIN             |                    |  3087 | 95697 |     7  (29)| 00:00:01 |
    |  12 |             SORT JOIN             |                    |   643 | 11574 |     2   (0)| 00:00:01 |
    |* 13 |              INDEX RANGE SCAN     | PS_ERN_PROGRAM_DEF |   643 | 11574 |     2   (0)| 00:00:01 |
    |* 14 |             SORT JOIN             |                    |    96 |  1248 |     5  (40)| 00:00:01 |
    |* 15 |              INDEX FAST FULL SCAN | PS_EARNINGS_TBL    |    96 |  1248 |     4  (25)| 00:00:01 |
    |* 16 |          INDEX RANGE SCAN         | PS_ERN_PROGRAM_DEF |   643 | 11574 |     2   (0)| 00:00:01 |
    |* 17 |         INDEX UNIQUE SCAN         | PS_EARNINGS_TBL    |     1 |    10 |     0   (0)| 00:00:01 |
    |* 18 |        TABLE ACCESS BY INDEX ROWID| PS_ERN_PROGRAM_TBL |     1 |    11 |     1   (0)| 00:00:01 |
    |* 19 |         INDEX UNIQUE SCAN         | PS_ERN_PROGRAM_TBL |     1 |       |     0   (0)| 00:00:01 |
    |* 20 |     INDEX RANGE SCAN              | PS_EARNINGS_TBL    |     1 |    10 |     1   (0)| 00:00:01 |
    |  21 |      SORT AGGREGATE               |                    |     1 |    10 |            |          |
    |* 22 |       INDEX RANGE SCAN            | PS_EARNINGS_TBL    |     1 |    10 |     2   (0)| 00:00:01 |
    |* 23 |    TABLE ACCESS BY INDEX ROWID    | PS_ERN_PROGRAM_TBL |     1 |    11 |     1   (0)| 00:00:01 |
    |* 24 |     INDEX UNIQUE SCAN             | PS_ERN_PROGRAM_TBL |     1 |       |     0   (0)| 00:00:01 |
    --------------------------------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
       4 - access("A"."ERN_PROGRAM"='VT' AND "A"."EFFDT"= (SELECT MAX("A"."EFFDT") FROM
                  SYSADM."PS_EARNINGS_TBL" "C",SYSADM."PS_ERN_PROGRAM_TBL" "B",SYSADM."PS_ERN_PROGRAM_DEF" "A",
                  (SELECT MAX(SYS_OP_UNDESCEND(SYS_OP_DESCEND("EFFDT"))) "VW_COL_1","D"."ERNCD" "ERNCD",ROWID
                  "ROWID" FROM SYSADM."PS_EARNINGS_TBL" "D","PS_ERN_PROGRAM_DEF" "A" WHERE
                  "A"."EFFDT"<=TO_DATE(:PPE_DATE,'YYYY-MM-DD') AND "A"."ERN_PROGRAM"='VT' AND
                  SYS_OP_UNDESCEND(SYS_OP_DESCEND("EFFDT"))<=INTERNAL_FUNCTION("A"."EFFDT") AND
                  SYS_OP_UNDESCEND(SYS_OP_DESCEND("EFFDT"))<=TO_DATE(:PPE_DATE,'YYYY-MM-DD') GROUP BY
                  "D"."ERNCD",ROWID) "VW_SQ_1" WHERE "ROWID"=ROWID AND
                  "A"."EFFDT"<=TO_DATE(:PPE_DATE,'YYYY-MM-DD') AND "A"."ERN_PROGRAM"='VT' AND
                  "A"."EFFDT"="B"."EFFDT" AND "B"."ERN_PROGRAM"='VT' AND "B"."EFF_STATUS"='A' AND
                  "B"."EFFDT"<=TO_DATE(:PPE_DATE,'YYYY-MM-DD') AND
                  SYS_OP_DESCEND("EFFDT")=SYS_OP_DESCEND("VW_COL_1") AND "ERNCD"="C"."ERNCD" AND
                  "C"."ERNCD"="A"."ERNCD" AND SYS_OP_UNDESCEND(SYS_OP_DESCEND("EFFDT"))="VW_COL_1") AND
                  "A"."ERNCD"=:ERNCD)
       8 - access("ROWID"=ROWID)
      13 - access("A"."ERN_PROGRAM"='VT' AND "A"."EFFDT"<=TO_DATE(:PPE_DATE,'YYYY-MM-DD'))
      14 - access(SYS_OP_UNDESCEND(SYS_OP_DESCEND("EFFDT"))<=INTERNAL_FUNCTION("A"."EFFDT"))
           filter(SYS_OP_UNDESCEND(SYS_OP_DESCEND("EFFDT"))<=INTERNAL_FUNCTION("A"."EFFDT"))
      15 - filter(SYS_OP_UNDESCEND(SYS_OP_DESCEND("EFFDT"))<=TO_DATE(:PPE_DATE,'YYYY-MM-DD'))
      16 - access("A"."ERN_PROGRAM"='VT' AND "A"."EFFDT"<=TO_DATE(:PPE_DATE,'YYYY-MM-DD'))
      17 - access("ERNCD"="C"."ERNCD" AND SYS_OP_DESCEND("EFFDT")=SYS_OP_DESCEND("VW_COL_1"))
           filter("C"."ERNCD"="A"."ERNCD" AND SYS_OP_UNDESCEND(SYS_OP_DESCEND("EFFDT"))="VW_COL_1")
      18 - filter("B"."EFF_STATUS"='A')
      19 - access("B"."ERN_PROGRAM"='VT' AND "A"."EFFDT"="B"."EFFDT")
           filter("B"."EFFDT"<=TO_DATE(:PPE_DATE,'YYYY-MM-DD'))
      20 - access("C"."ERNCD"=:ERNCD)
           filter(SYS_OP_UNDESCEND(SYS_OP_DESCEND("EFFDT"))= (SELECT
                  MAX(SYS_OP_UNDESCEND(SYS_OP_DESCEND("EFFDT"))) FROM SYSADM."PS_EARNINGS_TBL" "D" WHERE
                  SYS_OP_DESCEND("EFFDT") IS NOT NULL AND SYS_OP_DESCEND("EFFDT")>=SYS_OP_DESCEND(:B1) AND
                  "D"."ERNCD"=:B2 AND SYS_OP_UNDESCEND(SYS_OP_DESCEND("EFFDT"))<=:B3))
      22 - access("D"."ERNCD"=:B1 AND SYS_OP_DESCEND("EFFDT")>=SYS_OP_DESCEND(:B2) AND
                  SYS_OP_DESCEND("EFFDT") IS NOT NULL)
           filter(SYS_OP_UNDESCEND(SYS_OP_DESCEND("EFFDT"))<=:B1)
      23 - filter("B"."EFF_STATUS"='A')
      24 - access("B"."ERN_PROGRAM"='VT' AND "A"."EFFDT"="B"."EFFDT")
    Here's the bad autotrace:
    SQL> variable ppe_date varchar2(10)
    SQL> variable erncd varchar2(3)
    SQL> exec :ppe_date := '2009-10-10'
    SQL> exec :erncd := '01'
    SQL> SELECT COUNT(*)
      2  FROM PS_ERN_PROG_DESCR A
      3  WHERE A.ERN_PROGRAM = 'VT'
      4  AND A.ERNCD         = :erncd
      5  AND EFFDT           =
      6    (SELECT MAX(B.EFFDT)
      7    FROM PS_ERN_PROG_DESCR B
      8    WHERE B.ERN_PROGRAM = 'VT'
      9    AND B.EFFDT        <= TO_DATE(:ppe_date,'YYYY-MM-DD')
     10    );
    
      COUNT(*)
    ----------
             1
    
    Elapsed: 00:04:07.40
    
    Execution Plan
    ----------------------------------------------------------
       0      SELECT STATEMENT Optimizer=ALL_ROWS (Cost=20 Card=1 Bytes=33)
       1    0   SORT (AGGREGATE)
       2    1     NESTED LOOPS (Cost=3 Card=1 Bytes=33)
       3    2       NESTED LOOPS (Cost=2 Card=1 Bytes=22)
       4    3         INDEX (UNIQUE SCAN) OF 'PS_ERN_PROGRAM_DEF' (INDEX (UNIQUE)) (Cost=1 Card=1 Bytes=12)
       5    4           SORT (AGGREGATE)
       6    5             NESTED LOOPS (Cost=13 Card=1 Bytes=63)
       7    6               NESTED LOOPS (Cost=12 Card=1 Bytes=52)
       8    7                 HASH JOIN (Cost=12 Card=4 Bytes=168)
       9    8                   VIEW OF 'VW_SQ_1' (VIEW) (Cost=9 Card=88 Bytes=2112)
      10    9                     SORT (GROUP BY) (Cost=9 Card=88 Bytes=2728)
      11   10                       MERGE JOIN (Cost=7 Card=3087 Bytes=95697)
      12   11                         SORT (JOIN) (Cost=2 Card=643 Bytes=11574)
      13   12                           INDEX (RANGE SCAN) OF 'PS_ERN_PROGRAM_DEF' (INDEX (UNIQUE)) (Cost=2 Card=643 Bytes=11574)
      14   11                         SORT (JOIN) (Cost=5 Card=96 Bytes=1248)
      15   14                           INDEX (FAST FULL SCAN) OF 'PS_EARNINGS_TBL' (INDEX (UNIQUE)) (Cost=4 Card=96 Bytes=1248)
      16    8                   INDEX (RANGE SCAN) OF 'PS_ERN_PROGRAM_DEF' (INDEX (UNIQUE)) (Cost=2 Card=643 Bytes=11574)
      17    7                 INDEX (UNIQUE SCAN) OF 'PS_EARNINGS_TBL' (INDEX (UNIQUE)) (Cost=0 Card=1 Bytes=10)
      18    6               TABLE ACCESS (BY INDEX ROWID) OF 'PS_ERN_PROGRAM_TBL' (TABLE) (Cost=1 Card=1 Bytes=11)
      19   18                 INDEX (UNIQUE SCAN) OF 'PS_ERN_PROGRAM_TBL' (INDEX (UNIQUE)) (Cost=0 Card=1)
      20    3         INDEX (RANGE SCAN) OF 'PS_EARNINGS_TBL' (INDEX (UNIQUE)) (Cost=1 Card=1 Bytes=10)
      21   20           SORT (AGGREGATE)
      22   21             INDEX (RANGE SCAN) OF 'PS_EARNINGS_TBL' (INDEX (UNIQUE)) (Cost=2 Card=1 Bytes=10)
      23    2       TABLE ACCESS (BY INDEX ROWID) OF 'PS_ERN_PROGRAM_TBL' (TABLE) (Cost=1 Card=1 Bytes=11)
      24   23         INDEX (UNIQUE SCAN) OF 'PS_ERN_PROGRAM_TBL' (INDEX (UNIQUE)) (Cost=0 Card=1)
    
    Statistics
    ----------------------------------------------------------
           3820  recursive calls
             66  db block gets
        4677728  consistent gets
          80608  physical reads
              0  redo size
            232  bytes sent via SQL*Net to client
            278  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              2  sorts (memory)
              1  sorts (disk)
              1  rows processed
    
    SQL> spool off

    I think you have to hit some sort of bug in the optimizer. Do you have the histograms on the EFFDT column.

Maybe you are looking for

  • Pavillion g7 nitebook: creation of recovery disks

    Just bought a refurbished laptop (new never been used) that comes with windows 8. I want to spend to 8.1 and then windows 10. My problem is that it's said I can only create a recovery disk once. If I create a recovery disc now until I have the upgrad

  • Vista keeps restarting after the installation of updates

    I have IBM laptop computer a customer T61, Vista Home Premium. Starts and goes to the "Configuring updates 3 of 3, then it goes to"shutting down"and keeps restarting." I tried safe mode, last good, from CD and repair of Windows, nothing worked. Any i

  • Photos deleted from Windows Live Photo Gallery

    I deleted definitely copies of images in a subfolder (from Europe) from Windows Live Photo Gallery to see the orinals in the main folder (Best Europe) also deleted. It looked like this: Best Europe From Europe How can I get back them?

  • issues of regulation and printer

    Hello I'm having a few problems which I hope are fixable first isadding a bluetooth printer - I have asked in the past two weeks, how to install an and got answers, but when I go into the Panel there is no link to click for bluetooth devices and I kn

  • Split tunnel P501 CVPN 3005?

    I have a pix 501 configured as easy VPN client and CAN connect to my VPN from Cisco 3005 concentrator without problem in a test environment. Basic config - looks like this: vpngroup vpnclient * password *. vpnclient username * password *. vpnclient S