Performance question for date column

Hi All,
I have a select query which joins two tables with more than 20 million records each based on a where condition of year = 2006. Would creating an function based index on the date column help improve the performance. Please suggest any other alternatives. The query is supposed to return about 10 million records which is taking about 10 hrs right now. How can I improve the performance.
Thanks

Rob, Here is the explain plan. Any suggestions based on this information. Please refer me to any information on how to interpret this information. Thanks
| Id  | Operation            |  Name                      | Rows  | Bytes |TempSpc| Cost  | Pstart| Pstop |
|   0 | SELECT STATEMENT     |                            |   101K|    10M|       |   173K|       |       |
|   1 |  HASH JOIN           |                            |   101K|    10M|  3088K|   173K|       |       |
|   2 |   PARTITION RANGE ALL|                            |       |       |       |       |     1 |     9 |
|   3 |    TABLE ACCESS FULL | Table A                    |   101K|  1888K|       | 87464 |     1 |     9 |
|   4 |   PARTITION RANGE ALL|                            |       |       |       |       |     1 |     9 |
|   5 |    TABLE ACCESS FULL | Table B                    |   156K|    13M|       | 85454 |     1 |     9 |

Similar Messages

  • Using number datatype for date column

    Hi
    Is there a side effect for using "number" datatype for "date" column?
    If so, what is the disadvantage?
    Many thanks

    Hi,
    Ora_83 wrote:
    Hi
    Is there a side effect for using "number" datatype for "date" column?
    If so, what is the disadvantage?Yes, there's a definite disadvantage.
    Oracle provides date arithmetic and a number of functions for manipulating DATEs. None of them work with numbers.
    For example,
    SELECT    TRUNC (order_date, 'MONTH')     AS order_month
    ,       AVG (ship_date - order_date)     AS avg_delay
    FROM       orders
    GROUP BY  TRUNC (order_date, 'MONTH')
    ;order_month involves a DATE function; it's pretty easy to find the month that conatins order_date.
    avg_delay involves date arithmetic. It's extrememly easy to find how much the time passed between order_date and ship_date.
    Depending on how you code dates as numbers, doing either one of the above may be just as easy, but doing the other will be very difficult. You'll waste a lot of effort converting the NUMBERs to real DATEs whenever you need to manipulate them.
    Validation can be very difficult for NUMBERs, also.
    Watch this forum. It's a rare day when there's not some question about how to get around a problem caused by storing dates in a NUMBER (or VARCHAR2) column. Don't add to that. Always use DATE columns for dates.

  • APEX_UTIL.IR_FILTER with BETWEEN operator for date columns

    Hi,
    when I run my application I can set a BETWEEN-filter for date columns. I can't find a way how to use it with the APEX_UTIL.IR_FILTER function. Maybe I miss something?
    Documentation: http://download.oracle.com/docs/cd/E17556_01/doc/apirefs.40/e15519/apex_util.htm#CHDDDFBF
    Tobias

    Tobias,
    If you think about it, a "Between" is nothing more than a single line way to say
    WHERE :X >= :Y
    AND :X <= :Z
    So you should be able to apply two filters to the report using the LTE and GTE operators
    Hope this helps
    Doug Gault
    www.sumneva.com

  • JQuery format mask for date columns in tabular form

    Hi,
    How can I apply jQuery format mask for date columns in a tabular form?
    Thanks.
    Andy

    OK, I realized I didn't choose the default type as "Pl/SQL Expression", now it's working correctly.
    Thank you very much!

  • IFNULL Equivalent for Date Columns

    Hello experts,
    is it possible to have an ifunull like function for dates that aren't there in the DB on 10g. For example I get the date format in 00/00/00 and I want it to show 'N/A' instead.
    Best Regards

    Hi zaid,
    Write a case function on the date column f(x) like this,this will work
    case when date='00/00/00' then 'N/A' else date end;
    UPDATE POST
    check your date column data type....if its date or varchar.....change according to your requirment by using it in RPD
    like cast(date as varchar) then at answers end you apply this case function in f(x)
    Hope answers your question.
    Cheers,
    KK
    Edited by: Kranthi on Feb 8, 2011 2:41 AM

  • Attached document for data column in BPS Web application

    Hi,
       I have created layout for a BPS application, the layout has been configured to have the ability to allow the used to create the attached documentd for the data column. when the user open the layout through the planning profile, the icon for those documents is displayed and can be open by click those icons. After we generated the Web applicatios, those icons are gone and the user can not open them any more.
      I notice that there is document subcomponent under BPS-WB, I added that subcomponent to my web layout, it still not work.Anybody know how to display the attached documents on the Web, Is this doable?

    Hi Marc,
       I did exactly what you mention in your responce e-mail, but it still not work coreectly.
    following is my propperty configuration for layout and documents:
    Planning layout (layout_lay01)
    Only ready for output: True
    Row/Cell Selection: Cell
    Event on selection: true
    Document on planning layout (Document1)
    Layout: = layout_lay01
    Only ready for output: false
    When I launch the application through the Tcode BPS_WIF0
    There is no document icon display for each data columns which can been in UPSPL. Instead there is a generic document input/display space under the lauout,however there is no any document display within the box, and I can not input anything within the document box. I changes some of the property for the layout and document, but it not work.
    Did I forget some thing?

  • Edit Renderer for Date columns

    I tried to use EditRenderer for a column that is a Date. BC4J automatically renders this as DateField, but I don't want this, so I set the EditRenderer to something else. But it seems BC4J ignores this and renders it as DateField (for Varchar fields it works well).
    I use JDev 9.0.3.3 and UIX+JSP.

    I found it out: on the Control Hints tab change the Control type from "default" to "edit" and the EditRenderer works

  • Which type of index is useful for date columns with time stamp

    Hi all,
    I am using date column in the where clause of an SQL Query. The values stored in the date column are includes timestamp. The query is very slow and there is no index on the date column.
    Can any body suggest which index is better on date columns
    Thanks

    I am using date column in the where clause of an SQL Query.Dates a re hard queries to tune. This ...
    WHERE start_date BETWEEN to_date('01-SEP-05') AND to_date('02-SEP-05')...probably requires a very different execution plan to this...
    WHERE start_date BETWEEN to_date('01-JAN-01') AND to_date('02-SEP-05')Just bunging an index on the date column may speed up your specific query but break something else. So be careful.
    Cheers, APC

  • Performance question - Caching data of a big table

    Hi All,
    I have a general question about caching, I am using an Oracle 11g R2 database.
    I have a big table about 50 millions of rows that is accessed very often by my application. Some query runs slow and some are ok. But (obviously) when the data of this table are already in the cache (so basically when a user requests the same thing twice or many times) it runs very quickly.
    Does somebody has any recommendations about caching the data / table of this size ?
    Many thanks.

    Chiwatel wrote:
    With better formatting (I hope), sorry I am not used to the new forum !
    Plan hash value: 2501344126
    | Id  | Operation                            | Name          | Starts | E-Rows |E-Bytes| Cost (%CPU)| Pstart| Pstop | A-Rows |  A-Time  | Buffers | Reads  |  OMem |  1Mem | Used-Mem |
    |  0 | SELECT STATEMENT        |                    |      1 |        |      |  7232 (100)|      |      |  68539 |00:14:20.06 |    212K|  87545 |      |      |          |
    |  1 |  SORT ORDER BY                      |                |      1 |  7107 |  624K|  7232  (1)|      |      |  68539 |00:14:20.06 |    212K|  87545 |  3242K|  792K| 2881K (0)|
      2 |  NESTED LOOPS                      |                |      1 |        |      |            |      |      |  68539 |00:14:19.26 |    212K|  87545 |      |      |          |
    |  3 |    NESTED LOOPS                      |                |      1 |  7107 |  624K|  7230  (1)|      |      |  70492 |00:07:09.08 |    141K|  43779 |      |      |          |
    *  4 |    INDEX RANGE SCAN                | CM_MAINT_PK_ID |      1 |  7107 |  284K|    59  (0)|      |      |  70492 |00:00:04.90 |    496 |    453 |      |      |          |
    |  5 |    PARTITION RANGE ITERATOR        |                |  70492 |      1 |      |    1  (0)|  KEY |  KEY |  70492 |00:07:03.32 |    141K|  43326 |      |      |          |
    |*  6 |      INDEX UNIQUE SCAN              | D1T400P0      |  70492 |      1 |      |    1  (0)|  KEY |  KEY |  70492 |00:07:01.71 |    141K|  43326 |      |      |          |
    |*  7 |    TABLE ACCESS BY GLOBAL INDEX ROWID| D1_DVC_EVT    |  70492 |      1 |    49 |    2  (0)| ROWID | ROWID |  68539 |00:07:09.17 |  70656 |  43766 |      |      |          |
    Predicate Information (identified by operation id):
      4 - access("ERO"."MAINT_OBJ_CD"='D1-DEVICE' AND "ERO"."PK_VALUE1"='461089508922')
      6 - access("ERO"."DVC_EVT_ID"="E"."DVC_EVT_ID")
      7 - filter(("E"."DVC_EVT_TYPE_CD"='END-GSMLOWLEVEL-EXCP-SEV-1' OR "E"."DVC_EVT_TYPE_CD"='STR-GSMLOWLEVEL-EXCP-SEV-1'))
    Your user has executed a query to return 68,000 rows - what type of user is it, a human being cannot possibly cope with that much data and it's not entirely surprising that it might take quite some time to return it.
    One thing I'd check is whether you're always getting the same execution plan - Oracle's estimates here are out by a factor of about 95 (7,100 rows predicted vs. 68,500 returned) perhaps some of your variation in timing relates to plan changes.
    If you check the figures you'll see about half your time came from probing the unique index, and half came from visiting the table. In general it's hard to beat Oracle's caching algorithms, but indexes are often much smaller than the tables they cover, so it's possible that your best strategy is to protect this index at the cost of the table. Rather than trying to create a KEEP cache the index, though, you MIGHT find that you get some benefit from creating a RECYCLE cache for the table, using a small percentage of the available memory - the target is to fix things so that table blocks you won't revisit don't push index blocks you will revisit from memory.
    Another detail to consider is that if you are visiting the index and table completely randomly (for 68,500 locations) it's possible that you end up re-reading blocks several times in the course of the visit. If you order the intermediate result set from the from the driving table first you may find that you're walking the index and table in order and don't have to re-read any blocks. This is something only you can know, though.  THe code would have to change to include an inline view with a no_merge and no_eliminate_oby hint.
    Regards
    Jonathan Lewis

  • Wireing Question for Data Center

    I work in what I would consider to be a small/mid sized data center. We use two 6513 as the core/distribution for ~25 racks of servers.
    My question comes in the way of cabling the servers to the core. Currently they are using long patch cords between the 6513 and each server. Well it’s a mess, functional but messy.
    I'm trying to figure out the best way to clean up the mess and make it look professional.
    Most people seem to suggest 2 different ways to accomplish this:
    1) Install switches in each rack and run fiber from the core to the rack. Wire each server to the switch in the rack.
    2) Install 24/48 port patch panels between the core area and the racks.
    I'm wondering what people think of these ideas and if there are any other suggested ways of accomplishing this?
    Andy

    Hi Andy,
    Here's something that we used to do where I worked:
    We had 6509's with three/four 48 port blades servicing between 150 and 200 phones roughly. I had four total switches, one on each of four floors. So this would be roughly similar to your DC environment, only we're servicing longer horizontal runs and phones, not servers -- but the idea is the same (i.e. high density cabling issues).
    Lord knows that when you're plugging in 48 cables into one of those blades, it can get pretty crowded. And since we don't yet know how to alter the laws of physics that determine space requirements, we have to search for alternatives.
    Back to my environment: On three of the four floors, we just wired straight from the patch panel (that ran to floor locations) to the switch. Quite a mess when you're running in 48 cables to one blade! However, this is traditional and this is what we did. My cabling guy (very smart fella) suggested something else. At the time I was too chicken to do it on the other floors, but I did agree to try it on one floor. Here's what we did:
    He ran Cat5 (at the time, that was standard) connections in 48 cable bunches from an adjacent wall into the switch. They had RJ-45 connections so that they could plug in, and they were all nice and neat. On the other end, they plugged in to a series of punch down blocks (kind of like you see in a phone room for telephone structured cabling). These, in turn, were cross connected to floor locations on another punch down block that went to the floor locations. Now, whenever we wanted to make a connection live, we simply had to connect the correct CAT5 jumper wire from one punch down block to the other. You never touch the actual ports in the switch. They just stay where they are. All alterations are done on the punch down blocks. This keeps things nice and neat and there's no fiddling with cables in the switch area. Any time you need to put in a new blade, you just harness up 48 more cables (we called them pigtails) and put them in the new blade.
    NOTE: You could do the exact same thing with patch panels instead of punch down blocks, but with higher densities, it's a bit easier to use the blocks and takes up much less space.
    ADVANTAGES:
    * Very neat cable design at the switch side.
    * Never have to squeeze patch cables in and out.
    * Easy to trace cables (but just better to document them and you'll never have to trace them).
    * Makes moves, adds, and changes (particularly adds) very easy.
    DISADVANTAGES:
    * Not sure that you can do it with CAT6.
    * You have to get a punch down tool and actually punch cables (not too bad though after you do a few).
    * You need to make sure that you don't deprecate the rating on the cable by improperly terminating it (i.e. insufficient twists)
    Anyway, I haven't had a need to do this in a while and I no longer work at the same place, but my biggest concern would be if that meets with the CAT6 spec. Not sure about that, but your cabling person could probably tell you.
    I'm not a big fan of decentralizing the switches to remote locations. It can become cumbersome and difficult to manage if you end up with a lot of them. Also, it doesn't scale well and can end up with port waste (i.e. you have 24 servers in one cabinet on one switch and then along comes 25; you now have to buy another 12 or 24 port switch to service the need with either 11/23 ports going to waste -- not good).
    Good luck. Let us know how you make out. I'd be glad to go in to more detail if the above isn't explained well enough.
    Regards,
    Dave

  • Performance tuning for data retrieval for PCL4 cluster

    Hi all,
    I am using PCL4 cluster to read history of employee data. The FM modules used are HR_INFOTYPE_LOG_GET_LIST and HR_INFOTYPE_LOG_GET_DETAIL .
    Currently it is taking lot of time. Do we have any better methods.
    Thanks in advance.
    Regards,
    tjgupta

    Hi All,
    I am also facing performance problem with PCL4 Audit cluster.
    Please guide me how to do it in an efficient way.
    I am using it is follows:
    SELECT  client relid srtfd srtf2 histo aedtm uname pgmid versn clustr INTO CORRESPONDING FIELDS OF TABLE it_pcl4
    FROM pcl4  WHERE   relid EQ 'LA'
                      AND     srtf2 EQ '00'
                      AND     aedtm IN s_aedtm.
    Where, s_aedtm-low = '20000101' & s_aedtm-high = '99991231'
    Regards

  • Best Practice Question for Date Compares

    Hello,
    I'm far from an expert on Oracle and PL/SQL, so I may have this all wrong.  I'm working on some selection scripts, and the guy that wrote these before me likes to convert parts of dates to numbers in order to do a compare.  It seems to me a trunc(date, part) would be much more efficient.  Can anyone confirm my thoughts here?
    I'm seeing this a lot:
    AND    TO_NUMBER (TO_CHAR (scheduleddate, 'YYYY')) = TO_NUMBER (TO_CHAR (SYSDATE - 1, 'YYYY'))
    Seems to me that I'd be better off just doing:
    trunc(scheduleddate, 'YEAR') = trunc(SysDate, 'YEAR').
    Does that make sense?
    Thanks!
    Chad

    CSchrieber wrote:
    Hello,
    I'm far from an expert on Oracle and PL/SQL, so I may have this all wrong.  I'm working on some selection scripts, and the guy that wrote these before me likes to convert parts of dates to numbers in order to do a compare.  It seems to me a trunc(date, part) would be much more efficient.  Can anyone confirm my thoughts here?
    I'm seeing this a lot:
    AND    TO_NUMBER (TO_CHAR (scheduleddate, 'YYYY')) = TO_NUMBER (TO_CHAR (SYSDATE - 1, 'YYYY'))
    Seems to me that I'd be better off just doing:
    trunc(scheduleddate, 'YEAR') = trunc(SysDate, 'YEAR').
    Does that make sense?
    Thanks!
    Chad
    however , you might want to play around with it a bit to confirm you get the behavior you want in your context.  I've not had much reason to use trunc, and in testing a few things just now to reply to admin1, I got some results that surprised me.  Another little learning project for me now.
    But I stand behind the essence of my original reply.  The guy that wrote your original code was jumping through too many hoops (transform functions).

  • Performance Question for WL 5.1 on RedHat Linux 6.1

    I'm currently evaluating WL 5.1 and installed it on linux.
    I have installed the SUN JDK 1.2.2 for linux which should use
    native threads.
    When I start WL 5.1 I get the following message:
    LD_LIBRARY_PATH=/usr/local/weblogic/weblogic/lib/linux:/usr/local/weblog
    ic/weblogic/lib/linux
    Warning: native threads are not supported in this release
    What does this mean?
    Also I get the following messages:
    Fri Apr 07 08:59:38 CEST 2000:<A> <Posix Performance Pack> Could not
    initialize POSIX Performance Pack.
    Fri Apr 07 08:59:38 CEST 2000:<E> <Performance Pack> Unable to load
    performance pack, using Java I/O.
    How much does this impact the performance? Is it better to use NT instead
    of linux?
    thanks,
    Alex

    If you want to stick with Sun jdk, and don't want to see the error
    messages, set weblogic.system.nativeIO.enable=false in
    weblogic.properties. I wouldn't go to NT, because if you can afford it
    Solaris on SPARC will be your fastest most reliable platform. We have
    Solaris SPARC for production, and do our development on Lintel. For us
    staying in a POSIX environment overall keeps things like startup,
    environment setting, and make type scripts all on the same page.
    Ian
    Alexander Sommer wrote:
    >
    I'm currently evaluating WL 5.1 and installed it on linux.
    I have installed the SUN JDK 1.2.2 for linux which should use
    native threads.
    When I start WL 5.1 I get the following message:
    LD_LIBRARY_PATH=/usr/local/weblogic/weblogic/lib/linux:/usr/local/weblog
    ic/weblogic/lib/linux
    Warning: native threads are not supported in this release
    What does this mean?
    Also I get the following messages:
    Fri Apr 07 08:59:38 CEST 2000:<A> <Posix Performance Pack> Could not
    initialize POSIX Performance Pack.
    Fri Apr 07 08:59:38 CEST 2000:<E> <Performance Pack> Unable to load
    performance pack, using Java I/O.
    How much does this impact the performance? Is it better to use NT instead
    of linux?
    thanks,
    Alex--
    Ian R. Brandt
    Software Engineer
    Genomics Collaborative, Inc.
    99 Erie Street
    Cambridge, MA 02139
    (617)661-2400 Ext.244
    (617)661-8899 FAX
    [email protected]

  • Help ! for date column type

    Hi,
    I am having two tables tdz12 and tdf31. TDF31 is a date field. and TDZ12 is transactions history table. If I do
    11:30:39 SQL> alter session set nls_date_format='DD-MON-RRRR HH24:MI:SS';
    11:30:57 SQL> select c65201 from tdf31;
    C65201
    30-NOV-2006 00:00:00
    11:46:48 SQL> select distinct a9000 from tdz12 where a9000 >= '01-NOV-06';
    A9000
    01-NOV-2006 00:00:00
    02-NOV-2006 00:00:00
    03-NOV-2006 00:00:00
    04-NOV-2006 00:00:00
    06-NOV-2006 00:00:00
    07-NOV-2006 00:00:00
    08-NOV-2006 00:00:00
    09-NOV-2006 00:00:00
    10-NOV-2006 00:00:00
    11-NOV-2006 00:00:00
    13-NOV-2006 00:00:00
    14-NOV-2006 00:00:00
    15-NOV-2006 00:00:00
    16-NOV-2006 00:00:00
    17-NOV-2006 00:00:00
    18-NOV-2006 00:00:00
    20-NOV-2006 00:00:00
    21-NOV-2006 00:00:00
    22-NOV-2006 00:00:00
    23-NOV-2006 00:00:00
    24-NOV-2006 00:00:00
    25-NOV-2006 00:00:00
    27-NOV-2006 00:00:00
    28-NOV-2006 00:00:00
    29-NOV-2006 00:00:00
    30-NOV-2006 00:00:00
    26 rows selected.
    If I do
    11:26:39 SQL> select sum(a9060)
    11:27:52 2 from tdz12
    11:27:52 3 where A9000>=(select to_date(to_char(C65201,'YYYYMM')||'01','YYYYMMDD') FROM TDF31);
    SUM(A9060)
    0
    Why I am getting 0 records ? ( Pl tell me the reason, not alternate way to get records )
    thanks & regards
    PJP

    TRUNC(c65201,'MONTH')is a simpler alternative to
    TO_DATE(TO_CHAR(c65201,'YYYYMM')||'01','YYYYMMDD')although it will give the same result here.

  • One performance view for two classes, possible?

    Hi there,
    My system is still running 2007 R2. I am writing a MP now which contains two classes. There are few performance collection rules targeting those two classes. I want to create one performance view to display performance data for BOTH classes. Is it possible?
    I already created an instance group and added both classes as member of the group. By using the group, I can created one alert view to display alerts from either class. Can I use the same trick for the performance view? Thanks!

    In addition, we also can add a dashboard view with two columns for the two classes, and add performance widget for each column.
    Regards,
    Yan Li
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

Maybe you are looking for

  • Error message when clicking on links from thunderbird: Firefox.exe – Entry Point Not found

    When I click on any link in a Thunderbird email message I get the error message: Firefox.exe – Entry Point Not found The procedure entry point ?DllBlocklist_Initialize@@YAXXZ could not be located in the dynamic link library T:\PQligP sFuvy (X86)\pJPp

  • Net Price in Print Preview of Purchase Order

    Hi all,     I have a typical issue over here,,,   1. Created two similar materials A, B  with material type HALB, data in all the fields were same except material description. 2. maintained all excise details in J1ID 3. Created a PO for these two mat

  • DVD Media for my G4?

    Hi, I'm trying to burn some home movies to DVD...found out the hard way that the spindle of DVD+R's that I had wasn't going to work. I found the one Apple branded DVD-R that came with the computer back in the day (can't believe I still had it 7 years

  • Is find my iphone turned "on" by default?

    Is "find my iPhone" turned "ON" by default when you purchase a brand new iPhone 4?  Or do you have to go into mobileme and turn it on yourself?

  • Elements 12 photomerge-Panorama

    When selecting Photomerge Panorama in Elements 12, program crashes with error message "editor 12 has stopped working". Was working fine until last week then suddenly this started happening every time I attempt to run Panorama. Other Photomerge functi