Can i use an analytic function instead of a group by clause?

Can i use an analytic function instead of a group by clause? Will this help in any performance improvement?

analytic can sometimes avoid scanning the table more than once :
SQL> select ename,  sal, (select sum(sal) from emp where deptno=e.deptno) sum from emp e;
ENAME             SAL        SUM
SMITH             800      10875
ALLEN            1600       9400
WARD             1250       9400
JONES            2975      10875
MARTIN           1250       9400
BLAKE            2850       9400
CLARK            2450       8750
SCOTT            3000      10875
KING             5000       8750
TURNER           1500       9400
ADAMS            1100      10875
JAMES             950       9400
FORD             3000      10875
MILLER           1300       8750
14 rows selected.
Execution Plan
Plan hash value: 3189885365
| Id  | Operation          | Name | Rows  | Bytes | Cost (%CPU)| Time     |
|   0 | SELECT STATEMENT   |      |    14 |   182 |     3   (0)| 00:00:01 |
|   1 |  SORT AGGREGATE    |      |     1 |     7 |            |          |
|*  2 |   TABLE ACCESS FULL| EMP  |     5 |    35 |     3   (0)| 00:00:01 |
|   3 |  TABLE ACCESS FULL | EMP  |    14 |   182 |     3   (0)| 00:00:01 |
Predicate Information (identified by operation id):
   2 - filter("DEPTNO"=:B1)which could be rewritten as
SQL> select ename, sal, sum(sal) over (partition by deptno) sum from emp e;
ENAME             SAL        SUM
CLARK            2450       8750
KING             5000       8750
MILLER           1300       8750
JONES            2975      10875
FORD             3000      10875
ADAMS            1100      10875
SMITH             800      10875
SCOTT            3000      10875
WARD             1250       9400
TURNER           1500       9400
ALLEN            1600       9400
JAMES             950       9400
BLAKE            2850       9400
MARTIN           1250       9400
14 rows selected.
Execution Plan
Plan hash value: 1776581816
| Id  | Operation          | Name | Rows  | Bytes | Cost (%CPU)| Time     |
|   0 | SELECT STATEMENT   |      |    14 |   182 |     4  (25)| 00:00:01 |
|   1 |  WINDOW SORT       |      |    14 |   182 |     4  (25)| 00:00:01 |
|   2 |   TABLE ACCESS FULL| EMP  |    14 |   182 |     3   (0)| 00:00:01 |
---------------------------------------------------------------------------well, there is no group by and no visible performance enhancement in my example, but Oracle7, you must have written the query as :
SQL> select ename, sal, sum from emp e,(select deptno,sum(sal) sum from emp group by deptno) s where e.deptno=s.deptno;
ENAME             SAL        SUM
SMITH             800      10875
ALLEN            1600       9400
WARD             1250       9400
JONES            2975      10875
MARTIN           1250       9400
BLAKE            2850       9400
CLARK            2450       8750
SCOTT            3000      10875
KING             5000       8750
TURNER           1500       9400
ADAMS            1100      10875
JAMES             950       9400
FORD             3000      10875
MILLER           1300       8750
14 rows selected.
Execution Plan
Plan hash value: 2661063502
| Id  | Operation            | Name | Rows  | Bytes | Cost (%CPU)| Time     |
|   0 | SELECT STATEMENT     |      |    14 |   546 |     8  (25)| 00:00:01 |
|*  1 |  HASH JOIN           |      |    14 |   546 |     8  (25)| 00:00:01 |
|   2 |   VIEW               |      |     3 |    78 |     4  (25)| 00:00:01 |
|   3 |    HASH GROUP BY     |      |     3 |    21 |     4  (25)| 00:00:01 |
|   4 |     TABLE ACCESS FULL| EMP  |    14 |    98 |     3   (0)| 00:00:01 |
|   5 |   TABLE ACCESS FULL  | EMP  |    14 |   182 |     3   (0)| 00:00:01 |
-----------------------------------------------------------------------------So maybe it helps

Similar Messages

  • How can I use Seeburger java functions on SAP XI's user defined functions?

    Hi All,
    As my title implies; how can I use Seeburger java functions on SAP XI's user defined functions?  I've tried searching over the net in tutorials regarding this topic but I failed to find one; can someone provide me information regarding my question? thanks very much.
    best regards,
    Mike

    Hi Mike !
    You should check your documentation about which java classes you need to reference in the "import" section of your UDF. And also deploy the java classes into the java stack or include them as a imported archive in integration repository...it should be stated in the seeburger documentation.
    What kind of functions are you trying to use?
    Regards,
    Matias.

  • Can i use an alternate email instead of an apple ID for iMessage?

    can I use an alternate email instead of an apple ID for iMessage?

    iOS and OS X: Link your phone number and Apple ID for use with FaceTime and iMessage - Apple Support

  • Photoshop CC: Can't use the 3d function???

    Hello,
    I need help one this. I can't use the 3d function in photoshop cc and it gives me this error:
    http://i.imgur.com/Zn7e47d.png
    And here are my performance settings:
    http://i.imgur.com/A8rCi8J.png
    And here is the vram of my gpu:
    http://i.imgur.com/sSr5Knb.png
    And here is the paste from the system info thing:
    0bin - encrypted pastebin
    Ohh and i use windows 7 ultimate
    Anyone knows a fix for this as i can't live without
    Thanks!
    Regards,

  • Can we Use T Code MIRA instead of MIRO for posting incoming invoice?

    Hi All,
    Can we Use T Code MIRA instead of MIRO for posting incoming invoice?
    While trying to post a incoming invoice using MIRO, I am getting a error "HKONT is EMPTY". But when using MIRA i could get the invoice posted.
    And in which situations we use MIRA?
    Thanks in Advance
    Gopi Krishna

    Hello
    MIRA is for Invoice Verification in the Background
    Purpose
    This process is suitable for the following transactions:
    Posting invoices with mass amounts of data for which no item check is required
    Posting invoices referring to transactions not yet entered in the system
    Entering Invoices for Verification in the Background (Without Item List)
    When verifying invoices in the background, you enter only a small set of document header data, such as the invoice amount, the currency and the tax information. You also allocate the incoming invoice to a purchasing document or a vendor. The system saves the data and allocation criteria you enter.
    At a later point, the system verifies the invoice in the background. It uses the allocation criteria you entered to determine the item list. It then calculates the net total from the item list.
    If the net total = gross amount invoiced - tax amount (+/- tolerance), the system posts the invoice in the background.
    If the net total ¹ gross amount invoiced - tax amount (+/- tolerance), the system does not post the invoice in the background. It saves the document header data and the items determined in the background; the saved document then has to be processed manually in Invoice Verification.
    With Invoice Verification in the background, the system does not check for any quantity or price differences at item level. Since you do not enter any actual invoice item data, the system uses the default data for comparison.
    Regards
    Gregory Mathews

  • How can i use the project code instead of project xml?

    hello
    i use the sessionbean+toplink structure,after i finish the o-r mapping by using the mapping work bench,i generate the project xml file,then in the "session.xml" file,i refer to the project xml,then i can use it from sessionbean.
    i hear that if i use the project code instead of project xml file,it will be more performant,is that true?
    otherwise,how can i use the project code instead of project xml file?i mean, in "session.xml", i can use the "<project-xml>" tag to refer to the project xml file,then in my session bean,i get the server session by read the "session.xml" file.but if i use the project code,how can i refer it from the "session.xml"?the examples that come with the toplink installation only tell me how can i use the project xml file within the session bean,it don't give me any clue about using the project code in the sesion bean,who can give me a step-by-step instruction and code snippet?
    thank you very much?

    There is a slight performance gain during session load at startup but there is no difference at runtime. The choice of which to use is dependent upon you build process. Whether it is easier to submit a new version of the class into the comile build process vs an XML file. In most cases it is just a preference of the development team.
    When you use the project-class you'll need to generate the source code and compile it into your system. Typically it is packaged with the persistent classes. You may need to configure your environment so that the class-loaders have access to these classes (same for the XML case).
    When using the project-class you simply replace the project-xml entry like this:
    <project-class>oracle.toplink.demos.employee.relational.EmployeeProject</project-class>
    The DTD for the session.xml file is found at <TOPLINK_HOME>\core\sessions_4_5.dtd. It is also in the documentation at:
    http://otn.oracle.com/docs/products/ias/doc_library/90200doc_otn/toplink.903/b10064/a-sessio.htm#634246
    Doug Clarke
    Product Manager
    Oracle9iAS TopLink

  • TS3989 Can you use the search function in a shared photo stream? How?

    Can you use the search function in a shared photo stream? When I try to search in the shared photo stream it goes to search in my photos.

    I'm not sure there is a solution to your question, other than to not keep so many photos on your devices.  If you delete a photo from photo stream, it will delete it from all your devices.  To keep them, first save them to your camera roll (tap Edit, tap the photos, tap Share, tap Save to Camera Roll), then import them to your computer as explained here: http://support.apple.com/kb/HT4083.  However, given the number of photos you have, a much more practical solution would be to transfer them to your computer using an app like PhotoSync, which will select them all at once and transfer them over wifi.
    I'm not sure why you're seeing such a discrepancy in the amount of space taken up by your photos.  It's possible that something is corrupt given the large number of photos on your device.

  • Why can't use all the function when deployed Duke Bank successfully

    i am use the DukesBankApp.ear in j2eetutorial14 to deployed .When i change the "public Object ejbCreate() throws CreateException" to "public String ejbCreate() throws CreateException",deployed Duke Bank successfully
    But,I open the client,i can not use all the function. for example,when i creat new customer or account .Applecation message watch will say "remote exception"
    why?or send the true DukesBankApp.ear to me .My mailbox is "[email protected]"
    thinks!!!!! i want to receive your help imminence!think you very much!

    the sever log say:
    [#|2005-05-10T22:39:18.609+0800|&#20449;&#24687;|sun-appserver-pe8.0|javax.enterprise.system.container.ejb|_ThreadID=13;|
    javax.ejb.EJBException: createCustomer: Could not create Entity EJB; nested exception is: com.sun.jdo.api.persistence.support.JDOFatalUserException: JDO76604: JNDI lookup for cmp-resource 'jdbc/BankDB' failed.
    NestedException: javax.naming.NameNotFoundException: BankDB not found
         at com.sun.ebank.ejb.customer.CustomerControllerBean.createCustomer(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at com.sun.enterprise.security.SecurityUtil$2.run(SecurityUtil.java:146)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sun.enterprise.security.application.EJBSecurityManager.doAsPrivileged(EJBSecurityManager.java:930)
         at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:151)
         at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:128)
         at $Proxy27.createCustomer(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:117)
         at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:651)
         at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:190)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1653)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1513)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:895)
         at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:172)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:668)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.dispatch(SocketOrChannelConnectionImpl.java:375)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.read(SocketOrChannelConnectionImpl.java:284)
         at com.sun.corba.ee.impl.transport.ReaderThreadImpl.doWork(ReaderThreadImpl.java:73)
         at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:382)
    |#]

  • How many attribute views you can be used in analytical view

    how many attribute views you can be used in analytical view

    Any attribute declared at component level in "Attributes" tab can be used in any methods of the view
    WD_COMP_CONTROLLER->attribute
    Thanks
    Bhanu

  • Can I  use excel type functions embedded into an online pdf form, ie Qty x Price= total $

    Can I use excel type functions embedded into an online pdf form, ie Qty x Price= total $

    Let me tell you what I am sure about and what I am not sure about:
    I am sure that I want to be able to sell my products online. The industrial market that I sell to usually do not allow the maintenance people that find me on the web, do not have the ability to use credit cards in a typical shopping cart format due to the higher prices that the equipment I sell costs and that most people call me up to 'request a formal quotation' to give to their purchasing depart. So, my bright idea is to create numerous pdf files with very specific url's to match the very specific items that I sell. (1) item per pdf. I am thinking that the advantage to skipping the shopping cart approach and allowing the customer to fill in the qty of items, which would be mulitpled by the price of the item (a constant #) and then hitting a apply button, that would calculate subtotal price. Discounts for the qty the customer inputs (qty of items inputted by customer would be discounted on a percentage x base price) and a refresh the screen. It would allow for SEO advantages from what I have seen in the past in my very vertical market. All forms would be setup using the same functionality, just images, alt text, urls, and readable text would change.
    What I don't know- which is alot, then how to calculate shipping costs. I have a weight per item, which can be added up. I saw an Adobe blog that allows UPS shipping cost to be programmed in. I don't know how dreamweaver works, which was what the blog mentioned would allow for this updated, instantanious interface with UPS and calculating real shipping costs to a specific zip code. Shipping cost would be fluff to this page. The main thing would be to do allow the customer to be able to fill in a qty of the specific item on the page, calculate a discount if / then type thing, be able to have customer email to purchasing dept or print. I would date stamp it with verbage that pricing is valid for XX days and if I could get a copy emailed to me that would be icing on the cake. I believe that this non static pdf would be something different then the current competion and that it would allow for 100's of quotes to be generated without customers having to wait 15 minutes to an hour for me to process the exact document that they are looking for.
    Hajeks

  • I recently upgraded my Mac to Yosemite and I can't use the custom function (grayed out) in Image Trace Illustrator CS6 (physical version). Anyone else having this issue?

    I recently upgraded my Mac to Yosemite and I can't use the custom function (grayed out) in Image Trace Illustrator CS6 (physical version). Anyone else having this issue?

    Custom will show automatically as soon as you just edit some options. So just go ahead, you don't need to select "custom"

  • Cannon MP830 can't use the scanner function after upgrading to Mavericks.

    I have an Cannon MP830 and now I can't use the scanner function after upgrading to Mavericks.  Can someone help?

    There is no ICA driver for this model so you won't be able to use Image Capture or Preview. But there is a TWAIN scanner driver and the supporting MP Navigator application available for 10.8 from Canon, so you could try installing these and see if you can scan again.

  • I can't use the distribute function in livecycle design?

    I can't use the distribute function in livecycle design?
    I have spent many hours designing this and the feature is not able to work it is greyed out.
    I am using adobe XI (not pro). What am I doing wrong?

    Hello,
    Do you want to make the form editable?
    If yes,
    To make this you need to Reader Extend the form by following steps.
    - Open the form in Acrobat Professional.
    - Click on Advanced option and then on Enable usage rights…here you can select the various usage rights to be enabled.
    - Save the file.
    Now you can distribute this form and users can fill in save for their records, print.
    -Vijay

  • Can't use the facetime function

    I can use the wifi for Internet browsing, and also we have checked our broadband supplier, they stated that there is no problem with the wifi setting, but unfortunately, i can not use the FaceTime function, sometime even I can not access my apple ID,but for both incoming and outgoing FaceTime request, I would like to ask does any setting of the FaceTime? Please advise, (also I have already go to the repair shop  of my hometown for check, the have already change another I pad to me, but the FaceTime it is still not working.) thank you so much

    Just to cover the basics---
    Have to made sure that FaceTime is turned on?
    Go to Settings --> FaceTime --> On

  • Can't use the camera function in my ipod touch 4s while updated to iOS 6.0

    I can't use the camera function in my ipod touch 4s while updated to iOS 6.0.
    There is all black screen when I turn on my camera. 
    I open the restriction setting already.
    thank you.

    Try:
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Reset all settings
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup. See:
    iOS: How to back up
    - Restore to factory settings/new iOS device.

Maybe you are looking for

  • Regarding Digital Signatures and Seed Values

    Hi First let me explain my scenario i had done so far and then i will explain the problem i am facing. Scenario I had created an intercative form with 4 Text Fields along with two signature fields(So that the form has to be signed by two persons let

  • Clearing / deleting parameters from url

    hello, my servlet shows a table with customers. each customer has a link that calls the customer servlet with the parameter customerid, like this so when the user clicks on the customer the url in the browser becomes http://localhost:8080/customer?cu

  • Problem with a database

    hi all! i want the user to type in the name and the surname, then at the end of this program they get a score. but it is so accessibal that if you re-type your name in the name field you get back your old score. i'm having a few problems on class ggg

  • What about GRC Process Control 3.0

    Hi experts! I've read a lot of information about GRC AC 5.2/3. But no so much documents about the new version of PC. Right now we are trying to install and test a system parameterized in our laboratory. Is there a specific forum for PC? Has anyone in

  • Macbook Air freezes when changing screensaver

    I am having issues when I try to change my screensaver. Whenever I click on a different screensaver option, my Macbook Air freezes, and I have to force close System Preferences. I have no problems with changing my desktop wallpaper. I have restarted