Need advice for optimizing query for the use of function UPPERCASE

I would like to know if it would make a difference if I use the UPPER function in the WHERE clause compared to use in the SELECT statement. For example:
SELECT 
    2 AS ORDERID,
    'OFFC' AS RESULTTYPE,
    OFFC_CD AS GROUPCOL,
    SUM(FACE_AMT) AS TOT_FACE_AMT,
    SUM(PROJ_PREM_AMT) AS TOT_PROJ_PREM_AMT,
    COUNT(*) AS TOT_NUM_CASES,
    'YTD' AS RPTTYP
FROM
(
    SELECT
        FMI.ACCT_GRP_ID, FMI.GA_CD, FMI.OFFC_CD, FMI.GROUP_REALLOCATION, FMI.STAT_NAME
        ,CASE WHEN FMI.GROUP_REALLOCATION = 'Y' THEN
            SUM(NVL(FMI.FACE_AMT,0)) OVER (PARTITION BY FMI.ACCT_GRP_ID, FMI.AGNT_NAME, FMI.STAT_NAME, FMI.GROUP_REALLOCATION, FMI.LOB_NAME ORDER BY FMI.CA_CS_NUM DESC)
         ELSE
            NVL(FMI.FACE_AMT,0)
         END FACE_AMT
        ,CASE WHEN FMI.GROUP_REALLOCATION = 'Y' THEN
            SUM(NVL(FMI.PROJ_PREM_AMT,0)) OVER (PARTITION BY FMI.ACCT_GRP_ID, FMI.AGNT_NAME, FMI.STAT_NAME, FMI.GROUP_REALLOCATION, FMI.LOB_NAME ORDER BY FMI.CA_CS_NUM DESC) 
         ELSE
            NVL(FMI.PROJ_PREM_AMT,0)
         END PROJ_PREM_AMT    
        ,RANK() OVER (PARTITION BY FMI.ACCT_GRP_ID, FMI.AGNT_NAME, FMI.STAT_NAME, FMI.GROUP_REALLOCATION, FMI.LOB_NAME ORDER BY FMI.CA_CS_NUM) RANKING
    FROM
        IFV_FLD_MGMT_INFO FMI
        JOIN IFT_BAT_PARM BP
            ON  FMI.LST_STAT_DT >= (TO_DATE('01/01/' || TO_CHAR(TO_DATE(BP.PARM_DAT_VAL, 'YYYYMMDD'), 'YYYY'), 'MM/DD/YYYY'))
                AND BP.BAT_ID = 'CMISFLDMGMT_DT'
    WHERE   FMI.OFFC_CD IN (pOffcCd)
        AND FMI.SHOWINFMR = 'Y'
)
WHERE ((GROUP_REALLOCATION = 'Y' AND RANKING = 1) OR (GROUP_REALLOCATION = 'N'))
    AND UPPER(STAT_NAME) = 'PLACED'      
GROUP BY OFFC_CD
In the above code, it will make difference if I move function SHIFT of the WHERE clause of a SELECT statement in the inner query as SUPERIOR (CGI. STAT_NAME STAT_NAME)? There will be no long-term performance gain?

Published by: Kuul13 on July 13, 2009 12:25

Hello

Kuul13 wrote:
...
In the analytical functions d0 you want
PARTITION BY stat_name or
PARTITION OF SUPERIOR (stat_name)?
This will really make the difference in the wy data will be partitioned?

Yes.
PARTITION BY x means the same as
PARTITION BY y only if x = y. If stat_name = HIGH (stat_name), then why you never bother to say UPPER (stat_name)?

If so, then I guess that it may be prudent to use UPPER (STAT_NAME) in the IFV_FLD_MGMT_INFO that is used in the inner query view. In this way, I simply keep the changes in the view and all other queries that use this point of view (as in my example) can directly use STAT_NAME = 'PLACÉ' and not no longer necessary to change the column in the PARTITION clause. What is your suggestion?

That would certainly make the simplest coding. If the person who uses the display needs the stat_name unconverted, then I think that changing the display is a good idea.

Also, I can't move where the query condition internal because it will give me different results.

As far as I know, this would make the subquery produce fewer lines (that's why it would be more efficient). Since you are partitioning by stat_name, lines which produced the subquery would be identical to the lines he now produces and are kept by the Super request. I do not have your tables, so I can't test it really,

Tags: Database

Similar Questions

  • Guard application launch at the start of the appliance, also need advice for the implementation of network methods

    Hi all

    I'm new to the development of Blackberry and I'm writing a relatively simple application to run on 7.1.

    So far the development was interesting, I managed to create my user interface using resources online (mainly this forum), but today I tried to implement some of the network classes that I need and now I just met constant problems.

    I use Eclipse SDK 3.7.2 (the one that comes with the plugin RIM)

    First question:

    I'm not sure what I changed, but today I noticed that whenever I start the Simulator (by sim 9360) my application is started during the initial startup process. I don't think he did this before, but to be honest, I wasn't paying much attention. I think it starts at the start of the device is because I put a breakpoint in the constructor for my class from the main screen, which is hit before the Simulator happens even to the point where it is ready for user interaction. In addition, once it is ready, if I press the BB button, I see my registered application.

    I don't have it set to automatic start in .xml descriptior enforcement.

    I started this application on the HelloBlackBerry sample, here is my main method for the entry of the application:

    public static void main( String[] args ) {
            appSettings = AppSettings.fetch();
            // Create a new instance of the application and make the currently
            // running thread the application's event dispatch thread.
            HelloBlackBerry theApp = new HelloBlackBerry();
            theApp.enterEventDispatcher();
            //openConnection();
    
        }
    
    
    

    As far as I know, this is the only entry point for the application.

    More code

        public HelloBlackBerry() {
            // Push a screen onto the UI stack for rendering.
            mainScreen = new ScreenHelloBlackBerry();
            pushScreen( mainScreen );
        }
    

    Here is the method of. my class AppSettings fetch()

        // Retrieves a copy of the effective properties set from storage.
        public static AppSettings fetch()
        {
            AppSettings savedSettings = (AppSettings) _store.getContents();
            return new AppSettings(savedSettings);
        }
    

    Some of this code that I wrote myself, the persistence store cause the launch of my car?

    I tried to reset the Simulator to the factory settings, no change.

    All applications initialized during the startup of the device and then closed shortly after?

    Part 2: Need advice for the implementation of functions of network in the application

    I need to implement some methods that will retrieve data from a web service, and I also need to send data to this service. What I've read, the ConnectionFactory is the way to go. I want my application to make a request when the application is open and can check on a set interval. I didn't know exactly how to go about adding another thread for networking, I understand that network connections should not be created on the thread main event, so I tried to do this:

    The constructor of my class that implements screen (ScreenHelloBlackBerry), I use the following to create a modal dialog box to prompt the user for a username, I also try networking wire in the same segment of spawning:

            public ScreenHelloBlackBerry(){...initialize fields and managers, add it all together...then near the end
    
    //This will open the confirm dialog when the application is launched
            UiApplication.getUiApplication().invokeLater(new Runnable() {
                  public void run() {
                      openConfirmDialog();
                    //start connection - Possibly broken
                      ConnectionThread ct = new ConnectionThread();
                      ct.start();
                  }
            });
    

    I don't know if it's somehow OK to do, but it seems to work for what I need. I want a user who launches the application at the prompt, and if a user switch applications, when they come back they wondered again (unless they close the app and reopen it).

    Here is my ConnectionThread:

    public class ConnectionThread extends Thread
    {
    
        public void run()
        {
    
              ConnectionFactory connFact = new ConnectionFactory();
              ConnectionDescriptor connDesc;
              connDesc = connFact.getConnection("http://www.google.com");
              if (connDesc != null)
              {
                  HttpConnection httpConn;
                  httpConn = (HttpConnection)connDesc.getConnection();
                  try
                  {
                      final int iResponseCode = httpConn.getResponseCode();
                      UiApplication.getUiApplication().invokeLater(new Runnable()
                      {
                          public void run()
                          {
                              Dialog.alert("Response code: " +
                                            Integer.toString(iResponseCode));
    
                          }
                       });
                      httpConn.close();
    
                   }
                   catch (IOException e)
                   {
                     System.err.println("Caught IOException: "
                          + e.getMessage());
                   }
              }
        }
    }
    

    At the moment it has basically unmodified code from a sample that I found, I'll be retooling to meet my needs whenever I can make it work. I HAD this work to the point where, after the closed user confirm this dialog, a few moments later a an alert dialog appears with the 302 response code. I don't know what changed, but now it doesn't work at all, and if I try to scroll with the debugger, I can't past the httpCon.getResponseCode (). I've seen some mistakes earlier on "no record of service was set up", and I also had once a timeout exception.

    I'm sure I'm doing this wrong, but at the same time as I said WAS working, and now it is not. If someone has done this far, thank you very much for your time and advice are much appreciated.

    Also, should I try to start the thread of the network of the UIApplication class instead of the screen? There is currently very little happening in the class that extends UIApplication, do I spend most of my business logic out of the class of the screen and in the UIApplication class?

    Thanks in advance!

    Hi all

    Just to conclude this topic for those who are interested, I found an excellent guide to the implementation of networks in applications of BB, click here for a link.

    About my application being started at the start of the simulator of the device, I found that on a device real this behavior is not complied with, and in addition, the behaviour seems to have stopped after uninstallation and reinstallation of my Simulator.

    See you soon,.

  • Need advice for the graphic shape on the image display

    I would like to help plot a circle above an image that is displayed in the get in JLabel, the purpose is, when you click on the image, the image with a small circle apperas instead, we clicked. I used JLabel to display image in get by using imageLabel.setIcon (new ImageIcon("default.jpg"));

    I need to draw the circle/rectangle when I click on the image that I need to select the different points of the image by drawing rectangles circles above the image.
    If you understand my problem, please guide me for the same thing.

    Thank you

    Create your own class that extends JPanel, substitute the paintComponent() method to draw the background image, then go through a list of points where the user has clicked (you'll need to track clicks too) and draw circles it.
    Stick this Panel in your get the label place.

    That's how I'd do it (then again once, I'm not big on Swing these days).

  • Need advice for the new graphics card

    I have a desktop HP Pavilion a6610t with HP w1907 monitors. Windows 7 32 bit.  I want to upgrade to a graphics card that supports two monitors.  Games isn't a factor, but I'd like a card that does not become the neck of the bottle when you surf or work remotely.  I have a PCIe - x 16 available slot.  My price range is around us $100.

    What should I look for another as the PCIe - x 16 and the ability to support two monitors when you shop for a graphics card?  I think the AMD Radeon HD 6570 is a good starting point.  What do you think?

    Any information will be appreciated.

    Here are the specifications and the configurable option for your desktop HP Pavilion a6610t CTO. According to specifications, your system came from the factory with a 250 watt power supply. Most retail graphics cards require a power supply minimum system assessment of 300 watts or greater. The Radeon HD 6570 you noted requires a 400 watt or a bigger power supply. The CX500, CX600 Corsair are highly recommended, are favorites of the forum and are known to adapt to most cases of HP. For useful information on the selection of a graphics card that fits your computer and meets your needs, read Guide of Big_Dave of a discrete video card selection .

    Frank

  • Equium A200-1V0 - need advice for the new series of laptop

    I want to replace my Equium A200-1V0.
    I don't know not in range it originally was - base or more?

    What would be a good replacement for it now?
    What I use my current for internet, email, Word/Excel and simple games. I also use it to listen to the music and the iplayer.
    HD, also used to store photos and iTunes.

    I have a budget of about £300-£400
    Minimum specification of:
    Memory - 2 GB
    HD - 200 GB
    Intel processor - NOT a Celeron - duo or preference i3
    stereo speakers
    at least 2 USB ports
    HDMI port - optional
    Screen 15 ''

    Thanks in advance...

    Hey,.

    There are several laptops Toshiba with 15 screen I think that the important point is the price because other requirements such as 2 GB RAM, 200 GB, etc are no problem. Most laptop have 4GB or more of RAM and also tough with more disk space.
    Moreover the Intel Core i3 processor is standard CPU at the moment, some models have a Core i5

    Take a look at Satellite C650, L650 and L750. These models are to fundamental factors such as Internet, music, videos and simple games.

    You can compare all models on the official page of Toshiba:
    http://EU.computers.Toshiba-Europe.com/innovation/family/

  • Need advice for the purchase of a mini PCI Wireless

    Hello

    I have a laptop Toshiba I bought nearly two years ago. This laptop has an Intel 2200BG wireless chipset, which works, but the quality of connection is quite low. Sometimes, the connection speed climbs, sometimes it falls in total. I tried all the updates driver, power management tips and everything that could be found on the net. Some of these help, but there is always something that doesn't work as it should.

    Long story short, I decided to buy a mini pci wireless card. The problem is that these cards are nowhere to find. There is nothing on the Toshiba site, and apart from a few offers on eBay, there is almost nothing to choose. I know there are other options, but I prefer a mini pci card.

    Can someone help me on this issue?

    Thank you

    Peter.

    Hi Peter

    Can you please tell us which laptop model you have?

    In any case, the network without WIRE Intel 2200BG card is good enough and works very well on my Satellite M70 (with the latest driver). Download speed is very good and I do not need a wireless network card. I don't know what is the problem with WLAN connection in your case, but please try to test with another router WLAN (maybe your friends have all other routers). Also, install the latest WLAN driver for this card.

  • Choose the platform correct blackberry 10 for the use of functions such as call history, use of data, message records

    I want to design a blackberry 10 application that can fetch all call logs, data internate, messages through the application usage. Please help me choose the right platform that can provide all the APIs that are required for this application. 10 webworks Blackberry and Android runtime dosen't supports all API.

    Thank you.

    You can watch here

    https://developer.BlackBerry.com/native/documentation/Cascades/device_platform/invocation/invoking_c...

  • I need the scanner for hp officejet 4215 for the use of scan software

    I need the scanner software for hp officejet 4215 for the use of scan and when I press the scan button on the printer know any software to scan function.

    Hello

    Please use the following link:

    http://h10025.www1.HP.com/ewfrf/wc/softwareCategory?cc=us&LC=en&DLC=en&product=351106

    Kind regards.

  • Hello, im a student in England, student of architecture. I have the pack student for 12 months and I really need to know my limits with the use, (copyright licensing). I am allowed, except by using my home application to show works that i already have)

    Hello, im a student in England, student of architecture. I have the pack student for 12 months and I really need to know my limits with the use, (copyright licensing). I am allowed, except by using my home application to show works which I have already done (as portfolios) to architectural firms, I intend to request a placement to? also can I post my stuff (already did the work) on my blog or tumblr? I intend not to use for profit/money at all well (if I was I wouldn't ask you this lol). Thank you.

    Hi,

    Please see Licensing FAQ: where can I find the terms of membership and the terms of use?

    Hope that helps!

    Kind regards

    Sheena

  • Optimize the creation of table 2D for the use of memory and parallel processing

    I have, and application of data processing that requires generating a large matrix 2D with sin and cos values that must be updated constantly. It's my program in terms of speed and memory use and I want to optimize to the maximum the neck of the bottle. This is my current code:

    I tried to paralellisme iteration in the loop for to take advantage of the multi-core processor, but with shift registers I can't do. Also, I read that with in place element, structures I can reduce the memory usage, but don't know how to do this with a 2D array. This code can be optimized to improve the use of memory and speed?


  • I need help for the upgrade of my current system.

    I need help for the upgrade of my current system.

    I have SBS 2008 with (Exch 2007, SQL 2005, Sharepoint, backupexec 2010 for sbs) licenses.

    I want to make the larger environment using the following:

    (1) apply Virtualization

    (2) apply to the failover process (clustering)

    "(3) the environment must support adding server terminal server, ERP server, exchange server, domain controller, backup manager.

    Storage 4) that supports Raid (1 and 5)

    UTM excellent 6) that supports (SSL VPN, VPN Global)

    suitable backup solution 7)

    (8) good antivirus for clients

    my questions:

    (1) can you provide me with a good design for this environment

    (2) should I choose what operating system:

    Microsoft datacenter or company

    I know datacenter provide us the unlimited VM but needs per processor license

    so if I have two Grouped servers I want to buy 4 licenses

    and just 4 VMs per company license... to say that we have two servers and maintain 8 vms so wat happened if 1 goes down... How can I migrate the 4 virtual machines on the server failed to another server group... ? should I buy enterprise license?

    (3) if I get the SAN storage for data... How can I save this storage... should I get another SAN?

    (4) how can I upgrade SBS stad single server (windows standrad) without losing the licenses as Exch 2007, SQL 2005, sharepoint.is it a must to buy an edition full std server or there is a way to upgrade (license wise, I mean)?

    (5) what about win2k8 license for VM:

    lets say we have physical that has windows license so that enough to have windows for VM or should I buy windows for VM licenses?

    (6) can I use backExec license for SBS with windows 2008 standard

    (7) who better to virtualization AMD or INTEL

    (8) hyper V or VMware?

    (9) what of Microsoft data protection Manager... is this good?

    (10) what virtual machine manager? What are the benefites keys

    Thanks in advance

    Hello AnasAI,

    You can find the Server forums on TechNet support, please create a new post at the following link:

    http://social.technet.Microsoft.com/forums/en/category/WindowsServer/

  • Is it safe to use Safe Mod with networking for the use of the computer every day?

    Hi, my computer has problems to start normally and I was wondering, is it safe to use Safe Mod with networking for the use of the computer every day? I use the computer like 10 hours + every day. Is this correct and safe? Thank you

    Hello, Winston,

    It is actually for troubleshooting only.

    Networking Mode safe mode starts Windows in mode safe mode and includes the network drivers and services needed to access the Internet or other computers on your network.

    Some applications may not work properly or not at all if you use safe mode with networking for everyday computing.

    Wireless network adapter may not work when you use the Option "Safe Mode with network.

    http://support.Microsoft.com/kb/305616

    Safe mode disables most of the processes and services running. These services include the Windows Update service. »

  • Type of license for the use of Veritas Backup exec with the unit?

    Nobody knows the type of license (or order number) for the use of Veritas Backup exec with the unit?

    The customer is already using the product widely in their networks, which is the license includes?

    Thank you.

    HI -.

    We use Veritas for the backup device. You will need to contact your representative of Veritas for license information - it is not provided by Cisco. Since the unit running SQL (or MSDE 2000), you will need SQL Veritas agent to back up OPEN files. We do not use dirt, but only for the backup device before performing the upgrades. And we also to break the mirror set beforehand. http://www.Cisco.com/en/us/customer/products/SW/voicesw/ps2237/products_maintenance_guide_chapter09186a0080443809.html#wp1073824

    Ginger

  • What is the main reason for the use of SERIALLY_REUSABLE in your package?

    Hi Experts,

    What is the main reason for the use of SERIALLY_REUSABLE in your package?

    At first glance, the most popular reason seems that some developers forget to close cursors. Therefore, it is a good way to close automatically when your code is stopped during the same session.

    Second, if your business rules require that package variables still need to put the SERIALLY_REUSABLE default values is good for this.

    So, what's your reason?

    Thanks in advance.

    From http://docs.oracle.com/database/121/LNPLS/packages.htm#LNPLS99924:

    After the unit of work (call Server) a SERIALLY_REUSABLE complete package, Oracle database performs the following operations:

    • Closes all open cursors.
    • No free memory (for example, memory for collection and long VARCHAR2 variables)
    • Returns the instantiation of the package to the collection of reusable instantiations kept for this package.

    Explicit cursors in SERIALLY_REUSABLE packages:

    http://docs.Oracle.com/database/121/LNPLS/packages.htm#LNPLS99923

    I would not support using SERIALLY_REUSABLE instead of programming and the cursor's lifecycle management practices.

    > What is the main reason for the use of SERIALLY_REUSABLE in your package?

    If your package uses large amounts of memory in the State, especially in a multiuser environment heavy wherever the memory usage adds up and memory will not clean until the session is closed and the State is not held beyond the call to the package, then there's your use case.

  • Can we ignore alarm for the use of the disc on the disc?

    Hello

    There is a data store of close to 2 TB, assigned to a cluster of servers ESXi 5.

    We performed P2V to a number of physical hosts and now only get about 80 GB of free space left.  And we get an alarm for the use of the disc on the disc.

    We wonder if it will be a problem to keep only 80 GB of free space on the disk (we will not add another VM in this datatsore more in the future).

    Your opinion is requested.

    Thank you

    Yes. Veeam - as well as other applications of image - based backup creates a temporary while backup it VMs. depending on the activity of the drive of the guest during this time the snapshot could develop and fill the instant capture data store. More you customers backup simultaneously more risk. Unfortunately there is no rule on the amount of space free disk is needed, but the 80 GB seem to be really low. With a 2 TB data store, I suggest that book you at least 10% (preferably more) for snapshots.

    In addition to this, you need to monitor the disk space on a case where something goes wrong with a backup and snapshot cannot be cleaned automatically!

    André

Maybe you are looking for

  • iMac freezes El Cap 10.11.4

    My end 2009 27 "iMac freezes - mouse still works.  I have to make a hard stop & restart.  Here's my machine Info: iMac 10.1 Intel Core 2 Duo 3.06 GHz 1 processor 2 carrots 3 MB of L2 Cache 16 GB memory 1.07 GHz bus speed Boot Rom ver: IM101.00CC.B00

  • How can HDR-AS100V - I associate video files with GPS without PlayMemories House data?

    Video files are saved to: \MP_ROOT\100ANV01 and newspapers GPS is found in: \PRIVATE\SONY\GPS How can I connect without using PlayMemories House?Is there an API for databases to \AVF_INFO?How PlayMemories calculates the speed without having the GPS-l

  • Help with download of Windows Live Movie Maker!

    Hello! So, I tried to download because of Windows Live Movie Maker I have some videos that I want to change, and I heard that Movie Maker is awesome! When I go on the site for download, I get this: This version of Movie Maker is not available for Win

  • Blocking senders

    >How can I block several senders from outlook express? You have problems with programs Error messages Recent changes to your computer What you have already tried to solve the problem

  • Empty the deleted items folder

    When I do a "right click" to empty the deleted items folder, I get the message "do you want to permanently delete the items. I select 'Yes', but the messages are not deleted.  It started just past a week ago (I think that after some Vista updates hav