Ranking - TOP N

Hi,
We have to create a several TOP N scenarios on a universe built on top to BEx query. Since conditions in BEx query are not supported in Universe we created one in Universe using MDX.
Following is the syntax we used for the MDX TOP 10 customers by sales revenue measue. I don't want to prompt.
<FILTER EXPRESSION="Rank ([0CUST_SALES].CurrentMember, Order([0CUST_SALES].CurrentMember.Level.Members,  [Measures].[4FKC4CRQFE71L4O5GOCT4XYK4], BDESC) )"><CONDITION OPERATORCONDITION="LessOrEqual"><CONSTANT CAPTION="10"/></CONDITION></FILTER>
Syntax is ok but when this condition is placed in the query it doesn't bring back the results. Query runs forever and we ended cancelling the process/program on BW. Captured the MDX in BW and executed in MDXTEST. It runs forever too. Volume is not too high. If I remove the condition all the result set comes back in 30 secs. There is something wrong with the MDX being passed to BW,
BW is on 7.0 SP16 and XI 3.1.
Did anyone have success implementing this type of scenario? Any known issues resolved in later SPs? Any alternative solutions?
Thanks

Hi Muralidhar,
I have also same problam,can you tell me how you achived this?
Thanks,
Piyush

Similar Messages

  • Ranking Top N but excluding ties at Nth position

    Hi,
    I have a requirement where I need to do top N analysis report. I came across problem where we have ties at Nth position, my client want not to show any Nth value because that will be misleading and if there are 3 value at Nth place then what to remove. what he want is to exclude Nth values and show only until N -1th place.
    Show top 5 from following list:
    A 100
    B  75
    C 50
    D 25
    E 5
    F 5
    G 5
    H 4
    I 3
    Webi Rank function will give following:
    A 100
    B  75
    C 50
    D 25
    E 5
    F 5
    G 5
    What I want is way to get following:
    A 100
    B  75
    C 50
    D 25
    Any thought ?
    Thanks in Advance
    Kumar

    Let's say we have the grid like:
    Dimension 
    Measure 

    10 
















    Now, sort the measure column in descending order. we get:
    Dimension 
    Measure 

    10 
















    Now, create a variable:
    v_Filter =If(RunningCount([Dimension])<=5;1;0)
    Apply a block level filter as : v_Filter Equal To 1
    You always get top 5 rows, no matter tie occurs or not.
    Dimension 
    Measure 

    10 







  • WEBI Database ranking problem

    Hi,
    I have a problem with Add Database ranking feature in query filter in WEBI rich client.
    I have 100 products and would like to pull only top 10 products onto my report based on number of sales (measure). I am using SQL server 2008. But when I use this feature I am only getting a table with only top 4 products in my report. When I increase the number to sat 50 or 60 (top 50 products in my query) I am getting top 10 now.
    Is it a bug which can be fixed with any fix pack. Like I get only top 4 products if I choose top 10 in the ADD database ranking and I get 10 if I use any number greater than 63 in the query.
    Eg:
    Case1: Query: Database ranking : Top 10; Product (Dimension); based on Sales(measure)\
    Result: Table with only top 4 products sorted in descending order instead of 10 products
    Case2: Query: Database ranking : Top 63; Product (Dimension); based on Sales(measure)\
    Result: Table with only top 10 products sorted in descending order.
    Right now it meets my criteria of getting top 10 products when I use top 63 in the query, but I think there is something wrong with this work around. Please reply me with any solution.
    Thanks
    Sudhir.

    Initially I used an example of Product and Sales to explain, which are in reality SCREEN.NAME and AGG_SCREEN.ACTIVE_TIME_SUM respectively as shown below.
    SELECT
      sum (REP.dbo.AGG_SCREEN.ACTIVE_TIME_SUM),
    REP.dbo.SCREEN.NAME
    FROM
      REP.dbo.AGG_SCREEN INNER JOIN REP.dbo.SCREEN ON (REP.dbo.AGG_SCREEN.SCREEN_ID=REP.dbo.SCREEN.ID)
    WHERE
    REP.dbo.SCREEN.NAME  IN 
         SELECT
           View__1.Column__1
         FROM
         SELECT
           REP.dbo.SCREEN.NAME AS Column__1,
           RANK() OVER( ORDER BY REP.dbo.AGG_SCREEN.ACTIVE_TIME_SUM DESC  ) AS Rk__1
         FROM
          REP.dbo.AGG_SCREEN INNER JOIN REP.dbo.SCREEN ON (REP.dbo.AGG_SCREEN.SCREEN_ID=REP.dbo.SCREEN.ID)
         )  View__1
         WHERE  View__1.Rk__1  <=  10
    group by REP.dbo.SCREEN.NAME
    Note: text in bold represent changes I made to SQL generated to sum and group by when used against database.

  • How to get max ranking value?

    Hi Experts,
    I have a situation where I can calculate the ranked top 10 values of a key figure using a condition. One of the columns I have uses the ranking calculation.
    So I now have the top 10 values. I now need the maximum ranking value so I can know what the ranking is out of. So I would like to show the following:
    Rank     Out of
    1            157
    2            157
    3            157
    4            157
    10          157
    So even though I am only showing 10 values in need to know the maximum number of records for the 'Out of' column.
    Any ideas?

    Thanks for the responses. I've tried the maximum on the column, but it doesn't give me the correct value as ranking seems only to be a virtual number and thus is inaccessable.
    I've tried using the restricted and calculated key figure methods, but they don't bring back what I need.
    If I do a calculated key figure where I use the count operator, and then use exception aggregation using total and then using the characteristic I have in my my rows, all I get is a list of 1's.
    Is there something I'm missing in the calculated key figure?
    Thanks for the help!

  • Max. no. of rows in GridbagLayout

    Is there any limit for number of rows (y) in GridbagLayout?
    Recently I mistyped the 'Y' parameters as 888 during creating a GUI. The code compiled smoothly but it gave ArrayIndexOutOfBoundsException: 888 at run time.
    Anybody has some idea about it.
    vinod

    A word of advice; don't post the same question in a number of forums. You have posted it here in three different forums. The folks who will be the most help to you read most of the forums and the extra posting causes a waste of time and bandwidth.<BR><BR>My personal take on your problem is that if you are getting more than 65k rows, Excel is the wrong tool. You are looking at data, not information. The human mind doesn't really work that way, and while you might be getting the number out and be replacing an oldgreenbar report, I'd suggest that you look at what you really want to find out.<BR><BR>When drilling, you are normally looking for exceptions -- best performance and/or worst performance -- and the people who need the information need to know what they are looking for. Doing a report that returns 65K rows is not going to make it easier to manage a business. Think about using ranking, top 5% returns, and possibly some flags in the database to narrow the focus. Also, attribute dimesnions or focussing the drill can help.<BR><BR>I've done various types of decision support, analysis, and Executive Information Systems for over 20 years and I've seen what can be really useful. If a customer asks for a massive report, I try to determine how the information will be used and while it may be easy to give the customer what is requested, I normally also probvide my best estimation of a tool that provides the same information in a much more digestible way, using graphics, exception reporting, and better data orgainzation.<BR><BR>A 65k row drill doesn't really help anyone. There are better ways to get the same type of information.

  • This app is bad...

    Whenever I click on my app it immediately crashes. This happened every. Single. Time. I've uninstalled and reinstalled many times and it will work for 5 minutes, then start crashing again. Is there any solution at all for this?

    and some that don't agree:
    http://www.nbcnews.com/technology/gadgetbox/apple-maps-furor-overblown-1B6071011
    http://techcrunch.com/2012/10/06/consumer-reports-ios6-maps-competent-enough-iph one-5-ranked-top-smartphone/
    Regardless, if the iOS 6 Maps app doesn't work for you, then it doesn't work. Apple reports that they are working on improving their new Maps service. You can reports problems via these procedures:
    http://www.macrumors.com/2012/09/24/how-to-report-a-problem-with-ios-6-maps-data /. 
    Until iOS 6 Maps reaches the level of finesse necessary to be fully usable to you, take a look at some alternatives:
    Bing Maps offers a very good maps service with Bird's Eye, a feature similar to Flyover. It's arguably better than Google Maps.
    http://itunes.apple.com/us/app/bing/id345323231?mt=8  
    You can use Google Maps by creating a shortcut to the Home Screen with help from the article below.
    http://www.ign.com/articles/2012/09/20/how-to-get-google-maps-on-ios-6  
    MapQuest also has a very nice app available.
    http://itunes.apple.com/us/app/mapquest/id316126557?mt=8  
    Nokia Maps is another great service that you can add to your Home Screen via a web shortcut.
    http://m.maps.nokia.com  
    Waze is another very well reviewed app.
    https://itunes.apple.com/us/app/waze-social-gps-traffic-gas/id323229106?mt=8  
    Here's an article detailing how to receive Public Transport directions.
    http://www.wired.com/gadgetlab/2012/09/transit-apps-ios6-woes/?pid=3798  
    If you would like to send a suggestion to Apple, please go to
    http://www.apple.com/feedback
    (This information, with some additions and slight alterations to the phrasing, provided by kind courtesy of HuskieN, another poster in these forums)

  • Selecting records from table A where A.date = max of date from table B

    Hi,
    I am new to OBIEE, How can I build the following Oracle query in OBIEE....
    select a.F1, a.F2, a.F3, a.date
    from Table1 a
    where a.date in
    (select max(b.date) from Table2 b where
    b.F1 = a.F1
    GROUP BY by b.F1)
    I tried Rank, Top, Aggregate however did not get the desired result.
    Thanks, Rohit

    You can create another request and use the results of that request as a Subquery in the filtering of the master request.

  • Decrypt and Copy DVDs to Hard Drive easily and fast

    Summary:DVD43 can’t work well on your Windows 8/7/XP/Vista
    ((64-bit)? Today we’ll look at drop dead simple method to decrypt and
    copy DVDs with the best DVD43 alternative, so you can easily copy DVD
    movies to your hard drive.
    Have you ever wanted to make backup copies of your DVDs? DVD43 is a
    very popular free DVD decrypter to help you decrypt DVDs on the fly so
    that your DVD copy program can read DVD discs. Although DVD43 plug-in
    have been released to bring wide compatibility with Windows 64 bits,
    most DVD copy programs don't yet support decrypter plug-ins. Plus, DVD43
    can't deal with the new DVD copy protection for its relatively slow
    update. Therefore, in order to backup DVD effortlessly, you’d better to
    find a DVD43 alternative to copy DVD movies on Windows(Windows 8) included.
    In my view, a good alternative to DVD43 should be able to backup DVD
    with high quality and supports various DVD disc types to suite your
    needs. Here Brorsoft DVD Ripper
    is highly recommend to you. With it, you can decrypt, copy your
    protected DVD in Windows within a few simple clicks. Besides removing
    DVD copy protection, you can copy DVD movies to hard drive with original
    DVD structure or just backup the main movie as you want. What’s more,
    it also enables user to rip and convert DVD to a wide variety of video
    formats like MP4, MOV, M4V, MP4, WMV, AVI, MPG, FLV, MKV, etc for
    different use. If you're looking for DVD43 alternative for Mac, please turn to DVD Ripper for Mac.
    [How-to] Rip/Copy DVDs with Best DVD43 Alternative:
    Step 1. Load DVD info > Insert a source DVD in optical drive. Install and launch the excellent
    alternative tool for DVD43.
    Click disc button to load DVD movies. You can select subtitles and
    audio track (English, French, German, Spanish…) for each chapter. Forced
    subtitles can be attained, too.
    Step 2. Copy/backup your DVDs
    Option A - "Full Disc Copy" without anything loss
    Click quick button "Copy the entire disc" to starts copying disney DVD disc to hard drive maintaining the original structures.
    Option B - Directly Copy DVD main movie only
    P.S. If you want to encode your DVD media to a playable,
    editable format, just click the Format bar and choose your desired
    format from the drop-down list. Various output formats like MP4, MOV,
    MKV, FLV, WMV, AVI, etc. are provided. Moreover, kinds of presets for
    portable devices and video editing software like iPhone, iPad, iPod,
    iMovie, Final Cut Pro, Samsung, HTC, Motorola, etc. are provided to help
    you get videos with optimized settings to best fit your devices or
    software.
    Step 3. Start to rip and backup DVD on Windows > Click
    “Convert” button to start converting, copying DVD movies using the
    alternative to DVD43. When the conversion complete, you can get the
    converted videos and store, play, edit and share them anywhere you like.
    Editors' note: With decent decrypting capability, high
    quality video output and considerate backup solution and specific format
    templates for versatile PMP devices (iPad, iPhone, Apple TV, Xbox, PS3,
    Android tablets and phones, etc), Brorsoft DVD Ripper ranks top on the
    DVD ripping application list. Meanwhile Brorsoft provides excellent
    customer support service, including lifetime free upgrade of product and
    technical support. Users can contact the support staff via email for
    help and suggestion.
    Source:Get the Best DVD43 Alternative to copy DVD movies
    [quote] androidiosconvertertips.altervista.org/blog/alternative-for-dvd43-decrypt-and-copy-dvds-to-hard-drive-easily-and-fast/ [/quote]

    What you want to do is select the files you want to move then go File>Relocate Masters. Your images will then be referenced to a location you select. Aperture will still continue to manage the images, but the external hard drive must be connected if you want to make adjustments. Aperture will retain Metadata and any adjustment information. Your original images will stay unmodified on your external drive.
    Jeff

  • I am a chemistry teacher and trying to create an app for my students.   How can I learn to do this?

    I am a Chemistry teacher and am trying to create an app for my students.  Our books are way out of date and I am needing wisdom to learn to do this.  Please help!

    Hello and thank you for your email!  I am currently using the  2004 version of Prentice Hall.  Our books have been taped  many times and are in very rough shape.  We have one portable computer cart for our entire high school and do not have wi fi, yet our school in Ludington, MI has been ranked top 8% in the nation for academic success.  My passion is teaching kids to think outside the box and I believe teaching them to create an app for a tough chemistry concept will be am amazing experience!  I think the reason our American children are falling behind is because we are not teaching them according to the way they are wired.  I may be wrong but need to find out.  Creating this app will be both a learning experience and a research opportunity.  Thank you so much for your words of wisdom as I begin the uphill climb in my journey. Please don't hesitate to continue to send wisdom!
    Sincerely,
    Rebecca

  • IOS6 Maps function is terrible, can I restore the old one?

    Help. What has happened to the Map application in iOS6? It is terrible, almost unusable. The resolution is used to be good, now places I could easily see in fine detail are either gone from the map entirely or the resolution has been dowgraded significantly. Railway lines seem to have disapeared also? What has happened? Why release an update with significantly worse performance than the one it replaces? I need the map app and I can't really use it in it's current condition. Can I go back to the previous operating system? Is there a way of rolling back my system and restoring the old one?
    Thanks

    and some that don't agree:
    http://www.nbcnews.com/technology/gadgetbox/apple-maps-furor-overblown-1B6071011
    http://techcrunch.com/2012/10/06/consumer-reports-ios6-maps-competent-enough-iph one-5-ranked-top-smartphone/
    Regardless, if the iOS 6 Maps app doesn't work for you, then it doesn't work. Apple reports that they are working on improving their new Maps service. You can reports problems via these procedures:
    http://www.macrumors.com/2012/09/24/how-to-report-a-problem-with-ios-6-maps-data /. 
    Until iOS 6 Maps reaches the level of finesse necessary to be fully usable to you, take a look at some alternatives:
    Bing Maps offers a very good maps service with Bird's Eye, a feature similar to Flyover. It's arguably better than Google Maps.
    http://itunes.apple.com/us/app/bing/id345323231?mt=8  
    You can use Google Maps by creating a shortcut to the Home Screen with help from the article below.
    http://www.ign.com/articles/2012/09/20/how-to-get-google-maps-on-ios-6  
    MapQuest also has a very nice app available.
    http://itunes.apple.com/us/app/mapquest/id316126557?mt=8  
    Nokia Maps is another great service that you can add to your Home Screen via a web shortcut.
    http://m.maps.nokia.com  
    Waze is another very well reviewed app.
    https://itunes.apple.com/us/app/waze-social-gps-traffic-gas/id323229106?mt=8  
    Here's an article detailing how to receive Public Transport directions.
    http://www.wired.com/gadgetlab/2012/09/transit-apps-ios6-woes/?pid=3798  
    If you would like to send a suggestion to Apple, please go to
    http://www.apple.com/feedback
    (This information, with some additions and slight alterations to the phrasing, provided by kind courtesy of HuskieN, another poster in these forums)

  • Large Song Compilation shows in coverflow as individual items by Artist

    I recently imported a large compilation of songs in my iTunes. My problem is that when I go through coverflow, sorted by album, all the songs are separated into individual items by the artist. This is especially annoying due to the fact that the compilation is a ranked "Top 500" songs group, that I would like to see in the order by track like any other album. I have made the items a compilation under "get info", but that has not solved the problem. The songs also show up in alphabetical order by artist name on my iPod. How can I solve this?

    Try filling in the Album Artist field against all the songs with the term Various Artists.

  • Are blog entries searchable?

    We have recently deployed SP2013 corporate wide and some employees have started blogging. Some of the information they are putting out there are very helpful tips and tricks. However, I do not see any blog posts in the search results. I have to think these
    posts can be search results. I have tried to search the Internet, but it seems that because I am using the word blog the only results I am getting back are blog posts about searching. Can anyone point me in the right direction?
    Thank you!

    Yes blog is very much searchable may be they are not ranked top. Please look at below link where you can create a separate BLOG search scope so that user can only search blog.
    SharePoint
    2010 Search: Show up all blog entries from different sites at one place
    In another way, you can use a search result webpart to show all blog post which will be displayed from search.
    Please 'propose as answer' if it helped you, also 'vote helpful' if you like this reply.

  • Using ranking and sum to get top 5 products' share of total market

    Hi everybody,
    I have been playing around with ranking for a while now and I am stuck..
    I have a crosstab where I want to show the top 5 products in a specific month. So I have month in my column and products in my rows. I applied a ranking based on revenue only showing the top 5 products. This works like a charm.
    Now I would like to sum up the top 5 products' revenue and compare it with the revenue of all products in the market. I have managed to sum the top 5 products' revenue by using the "sum" function in the block, but I have not been able to compare this measure with a total market revenue measure. It seems like because I made the ranking on the top 5 products I cannot create a measure which includes more than these top 5 products and put it in that block.
    Is this not something Webi can easily handle??
    Thanks in advance!
    Best regards,
    Morten

    Hi Jaime,
    Thank for the suggestion. I forgot to mention that the month column is only showing one month. There is a filter on the month dimension, so that only one month is shown.
    I tried using the In Report context, but it gave me wrong results... It seems like it included all months.. I also tried using the noFilter function, but it also gave me wrong results.
    Best regards,
    Morten

  • Top 'n' using rank () function

    Hi...
    I'm using BO XI 3.0. In my report I need  a user to enter TOP 'n' (n=5,10,20,50,100).
    For example:
    Caller No           No of Calls
    23467891              10
    67698089              35
    22377868              17
    76378467              10
    76374678              20
    89978978               6
    87786777              11
    I already create dimension object for Caller No and measure object for No of Calls in universe.
    So I use a rank filter in edit query but it doesn't work.
    I also create another measure object in universe name =ranking
    rank(No_of_Calls) over(partition by (Caller No) order by (No_of_Calls)).. but it's not work...
    So can anybody help me....thanks

    Hi,
    Following information might be helpful in resolving the issue.
    General Syntax of Ranking :
    Rank( measure; (dimensions); [Top|Bottom])
    Here is the work flow with an example :- (use efashion universe )
    1) Create a webi report selecting objects quarter, year, sales revenue and create a cross tab
    2) While creating a cross tab, use the Object Year in columns and object Quarter for rows.
    3)Define a variable Var1 = Rank ([Sales Revenue] ; [Quarter]; [Year]) ForEach ([Year])
    4) Insert a blank column next to year in the cross tab.
    5) Drag and drop the variable Var1 in the new blank column inserted next to Object Year..
    You will now find that you have ranking for the years 2001, 2002, 2003 being reflected
    independently.
    Regards,
    Sarbhjeet Kaur

  • Is rank() really better than rownum for top-n-queries?

    Several sources say that for Oracle databases rank() should be used instead of 'rownum <= n' for top-n-queries. But here we have an application, where we a lot of top-n queries are executed on a big table with several million rows and rank() has a quite bad performance. I get much better results when I use a query with rownum <= n but the programmer of the application doesn't want to change it in the software because of those articles about rank() and rownum. I wonder, whether it is possible, to find a better form of the rank()-query or an additional index, that gives me the same performance.
    To explain my case I created the following example (if you try it, be aware that depending on the size of your dba_objects view you might need up to half a gig free space in your tablespace for this example).
    create table big_objects
    as
    select
    ascii(m.alpha)*100000+o.object_id object_id,
    o.owner owner,
    o.object_type,
    m.alpha||'_'||o.object_name object_name,
    sysdate-400+mod(100*object_id+99*ascii(m.alpha),365)+24/(o.object_id+ascii(m.alpha)) created,
    o.status
    from
    (select distinct
    upper(substr(object_name,1,1)) alpha
    from
    sys.dba_objects
    where
    upper(substr(object_name,1,1)) between 'A' and 'Z') m,
    sys.dba_objects o
    order by
    object_name;
    create index bigindex_1 on big_objects (owner, object_type, created);
    analyze table big_objects compute statistics;
    So my table looks a bit like dba_objects but with much more rows and I made a synthetic "created" date which is more similar to my real case, where top-n means a date selection of the newest records from a certain type.
    Here is the size of the segments on an nearly empty 11gR2 database:
    select segment_name, bytes, blocks from sys.dba_segments where segment_name like 'BIG%'
    SEGMENT_NAME BYTES BLOCKS
    BIGINDEX_1 75497472 9216
    BIG_OBJECTS 142606336 17408
    On my database the example table has approx. 1,9 Mio rows:
    select count(*) from big_objects;
    COUNT(*)
    1884246
    and some 1,4% of those rows have owner = 'SYS' and object_type = 'INDEX'
    select
    count(*)
    from big_objects
    where owner = 'SYS'
    and object_type = 'INDEX';
    COUNT(*)
    25896
    But I want to find only the 10 newest indexes for the owner SYS. I think the typical rank() approach would be:
    select
    owner,
    object_type,
    object_name,
    object_id,
    status,
    created
    from
    ( select
    owner,
    object_type,
    object_name,
    object_id,
    status,
    created,
    rank() over (order by created desc) rnk
    from
    big_objects
    where
    owner = 'SYS'
    and object_type = 'INDEX')
    where rnk <= 10
    order by created asc;
    OWNER OBJECT_TYPE OBJECT_NAME OBJECT_ID STATUS CREATED
    SYS INDEX B_COLLELEMIND 6600515 VALID 15.04.2010 19:05:55
    SYS INDEX V_I_WRI$_OPTSTAT_IND_OBJ#_ST 8600466 VALID 15.04.2010 19:09:03
    SYS INDEX G_I_RLS 7100375 VALID 15.04.2010 19:23:55
    SYS INDEX V_I_DIR$SERVICE_UI 8600320 VALID 15.04.2010 19:31:33
    SYS INDEX L_I_TSM_DST2$ 7600308 VALID 15.04.2010 19:36:26
    SYS INDEX L_I_IDL_UB11 7600235 VALID 15.04.2010 19:57:34
    SYS INDEX V_I_VIEWTRCOL1 8600174 VALID 15.04.2010 20:19:21
    SYS INDEX L_I_TRIGGER2 7600162 VALID 15.04.2010 20:31:39
    SYS INDEX L_I_NTAB1 7600089 VALID 15.04.2010 21:35:53
    SYS INDEX B_I_SYN1 6600077 VALID 15.04.2010 22:08:07
    10 rows selected.
    Elapsed: 00:00:00.22
    Execution Plan
    Plan hash value: 2911012437
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 1427 | 188K| 1400 (1)| 00:00:17 |
    | 1 | SORT ORDER BY | | 1427 | 188K| 1400 (1)| 00:00:17 |
    |* 2 | VIEW | | 1427 | 188K| 1399 (1)| 00:00:17 |
    |* 3 | WINDOW SORT PUSHED RANK | | 1427 | 79912 | 1399 (1)| 00:00:17 |
    | 4 | TABLE ACCESS BY INDEX ROWID| BIG_OBJECTS | 1427 | 79912 | 1398 (0)| 00:00:17 |
    |* 5 | INDEX RANGE SCAN | BIGINDEX_1 | 1427 | | 9 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    2 - filter("RNK"<=10)
    3 - filter(RANK() OVER ( ORDER BY INTERNAL_FUNCTION("CREATED") DESC )<=10)
    5 - access("OWNER"='SYS' AND "OBJECT_TYPE"='INDEX')
    Statistics
    1 recursive calls
    0 db block gets
    25870 consistent gets
    0 physical reads
    0 redo size
    1281 bytes sent via SQL*Net to client
    524 bytes received via SQL*Net from client
    2 SQL*Net roundtrips to/from client
    2 sorts (memory)
    0 sorts (disk)
    10 rows processed
    As from the index only the first two columns are used, all the 25896 records that I found above are read and sorted just to find the ten newest ones. Many unnecessary blocks are read and luckily all needed database blocks were in memory already. In our real case quite often a lot of physical reads are performed, which makes the performance of the application even worse.
    In my following example with a "rownum <= 10" all three columns of the index are used and the number of block gets is much, much smaller than in the rank() example.
    select
    owner,
    object_type,
    object_name,
    object_id,
    status,
    created
    from
    big_objects
    where
    (owner, object_type, created)
    in
    ( select
    owner,
    object_type,
    created
    from
    ( select /*+ first_rows(10) */
    owner,
    object_type,
    created
    from
    big_objects
    where
    owner = 'SYS'
    and object_type = 'INDEX'
    order by
    owner,
    object_type,
    created desc
    where rownum <= 10
    order by created asc;
    OWNER OBJECT_TYPE OBJECT_NAME OBJECT_ID STATUS CREATED
    SYS INDEX B_COLLELEMIND 6600515 VALID 15.04.2010 19:05:55
    SYS INDEX V_I_WRI$_OPTSTAT_IND_OBJ#_ST 8600466 VALID 15.04.2010 19:09:03
    SYS INDEX G_I_RLS 7100375 VALID 15.04.2010 19:23:55
    SYS INDEX V_I_DIR$SERVICE_UI 8600320 VALID 15.04.2010 19:31:33
    SYS INDEX L_I_TSM_DST2$ 7600308 VALID 15.04.2010 19:36:26
    SYS INDEX L_I_IDL_UB11 7600235 VALID 15.04.2010 19:57:34
    SYS INDEX V_I_VIEWTRCOL1 8600174 VALID 15.04.2010 20:19:21
    SYS INDEX L_I_TRIGGER2 7600162 VALID 15.04.2010 20:31:39
    SYS INDEX L_I_NTAB1 7600089 VALID 15.04.2010 21:35:53
    SYS INDEX B_I_SYN1 6600077 VALID 15.04.2010 22:08:07
    10 rows selected.
    Elapsed: 00:00:00.03
    Execution Plan
    Plan hash value: 3360237620
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 10 | 760 | 17 (0)| 00:00:01 |
    | 1 | SORT ORDER BY | | 10 | 760 | 17 (0)| 00:00:01 |
    | 2 | NESTED LOOPS | | | | | |
    | 3 | NESTED LOOPS | | 10 | 760 | 17 (0)| 00:00:01 |
    | 4 | VIEW | VW_NSO_1 | 10 | 200 | 2 (50)| 00:00:01 |
    | 5 | HASH UNIQUE | | 10 | 200 | 4 (25)| 00:00:01 |
    |* 6 | COUNT STOPKEY | | | | | |
    | 7 | VIEW | | 11 | 220 | 3 (0)| 00:00:01 |
    |* 8 | INDEX RANGE SCAN DESCENDING| BIGINDEX_1 | 1427 | 28540 | 3 (0)| 00:00:01 |
    |* 9 | INDEX RANGE SCAN | BIGINDEX_1 | 3 | | 2 (0)| 00:00:01 |
    | 10 | TABLE ACCESS BY INDEX ROWID | BIG_OBJECTS | 3 | 168 | 6 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    6 - filter(ROWNUM<=10)
    8 - access("OWNER"='SYS' AND "OBJECT_TYPE"='INDEX')
    9 - access("OWNER"="OWNER" AND "OBJECT_TYPE"="OBJECT_TYPE" AND "CREATED"="CREATED")
    Statistics
    1 recursive calls
    0 db block gets
    26 consistent gets
    0 physical reads
    0 redo size
    1281 bytes sent via SQL*Net to client
    524 bytes received via SQL*Net from client
    2 SQL*Net roundtrips to/from client
    1 sorts (memory)
    0 sorts (disk)
    10 rows processed
    I made this comparison with the Oracle versions 10.2 and 11.2 and the result was more or less the same. How can I change the rank() query in a way that only the small number of really needed blocks are read from the database?

    this was exactly the hint, I was looking for. Generally speaking hints are not the preferred way to go to tune queries. They can have nasty side-effects when data changes.
    Now the rank()-query is similar fast and much better to read than my fast one with three nested SELECTs.
    Your rownum query was needlessly complicated, and could be simplified to:
    select owner, object_type, object_name, object_id, status, created
    from (select owner, object_type, created
          from big_objects
          where owner = 'SYS' and
                object_type = 'INDEX'
          order by created desc)
    where rownum <= 10
    order by created ascand very likely get the same speed.
    One more question. How did you format those sql queries and results. When I copy/paste them into the editor of forums.oracle.com the format allways gets lost.To preserve formatting use {noformat}{noformat} before and after the section you want ot keep formatted.  In general, if you want to see how someone generated an effect, reply to the post and hit the quote original icon.  You will see all the formatting codes used in the original.
    John                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Maybe you are looking for

  • Swap Image not working Except in IE

    I am working on a class project, and we've just learned how to do "swap image" on rollover. It's working beautifully when in IE, but in Firefox it's not working at all and in Opera it's working strangely (only when on the "edges" of the flash text no

  • Why won't my hyperlink keep the paragraph format?

    I am working in FM11. I have a bulleted list of my heading 2 name and numbers. When I add a cross-reference for source type Paragraphs and insert my heading 2, select my reference format for HeadingName_and_Number, it changes to a cross reference mar

  • Heavy CPU Utilization of Dictionary Query - After 9i to 10g Upgrade

    Hi Friends, We have migrated our production DB from Oracle 9i(Windows) to Oracle 10g(AIX) and after that a heavy cpu utilization query is coming frequently and hence many timeouts are happening in the application. Application is connecting to the dat

  • Create Custom Button

    I would like to make a button that initiates the "run sequence" and at the same time sets all the values to default. Is it possible to create a custom button that does this action. If so how do you create the custom button.

  • Im trying to install CS6 Web & Design Premium (Student Version).

    Im getting adobe error message. "Installer failed to initialize. this could be due to a missing file" Please help!! I am using a Mac Book Pro 2 GHz OS 10.6.8 I did a system restore and a software update before attempting the install. You can email me