Performance of query using view - what is happening here

Hi,
I can't explain the difference in performance between two queeries.
For a datawarehouse I have 3 tables from 3 different sources, named source1, source2 and
source3 they all have the identical columns:
client_key
,client_revenue
source1 has 90.000.000 rows, source2 1.000.000 rows and source3 50.000 rows
I also made a view say, all_clients which is the union of the 3 tables plus a constant column called 'source'
which corresponds to the table_name.
If I run a query which shows the number of records it takes 15-20 minutes:
select source,count(*)
from all_clients
group by source.
If i run the following query it takes about 5 minutes!
select 'source1',count(*)
from source1
union
select 'source2',count(*)
from source2
union
select 'source3',count(*)
from source3.
What makes the difference?

Hmmm... Interesting. In my small example things seem pretty similar. Have you done the explain plans?
An observation is that you are using a UNION rather than a UNION ALL which would be better as you may be incurring an unnecessary SORT UNIQUE.
create table tab1 as(select object_id, object_type from all_objects);
create table tab2 as(select object_id, object_type from all_objects);
create table tab3 as(select object_id, object_type from all_objects);
analyze table tab1 estimate statistics;
analyze table tab2 estimate statistics;
analyze table tab3 estimate statistics;
create view v_tab123 as(select 'source1' source,count(*) cnt
from tab1
union
select 'source2',count(*)
from tab2
union
select 'source3',count(*)
from tab3);
select 'source1' source,count(*) cnt
from tab1
union
select 'source2',count(*)
from tab2
union
select 'source3',count(*)
from tab3;
Operation     Object Name     Rows     Bytes     Cost     TQ     In/Out     PStart     PStop
SELECT STATEMENT Hint=CHOOSE          3           180                     
SORT UNIQUE          3           180                     
UNION-ALL                                        
SORT AGGREGATE          1           60                     
TABLE ACCESS FULL     TAB1     38 K          10                     
SORT AGGREGATE          1           60                     
TABLE ACCESS FULL     TAB2     38 K          10                     
SORT AGGREGATE          1           60                     
TABLE ACCESS FULL     TAB3     38 K          10                     
-- Union
select source, cnt from(
select 'source1' source,count(*) cnt
from tab1
union
select 'source2',count(*)
from tab2
union
select 'source3',count(*)
from tab3)
Operation     Object Name     Rows     Bytes     Cost     TQ     In/Out     PStart     PStop
SELECT STATEMENT Hint=CHOOSE          3           180                     
VIEW          3      54      180                     
SORT UNIQUE          3           180                     
UNION-ALL                                        
SORT AGGREGATE          1           60                     
TABLE ACCESS FULL     TAB1     38 K          10                     
SORT AGGREGATE          1           60                     
TABLE ACCESS FULL     TAB2     38 K          10                     
SORT AGGREGATE          1           60                     
TABLE ACCESS FULL     TAB3     38 K          10                     
-- Union ALL
select source, cnt from(
select 'source1' source,count(*) cnt
from tab1
union ALL
select 'source2',count(*)
from tab2
union ALL
select 'source3',count(*)
from tab3)
Operation     Object Name     Rows     Bytes     Cost     TQ     In/Out     PStart     PStop
SELECT STATEMENT Hint=CHOOSE          3           180                     
VIEW          3      54      180                     
SORT UNIQUE          3           180      <<<<============== Unnecessary           
UNION-ALL                                        
SORT AGGREGATE          1           60                     
TABLE ACCESS FULL     TAB1     38 K          10                     
SORT AGGREGATE          1           60                     
TABLE ACCESS FULL     TAB2     38 K          10                     
SORT AGGREGATE          1           60                     
TABLE ACCESS FULL     TAB3     38 K          10                     
analyze table tab1 delete statistics;
analyze table tab2 delete statistics;
analyze table tab3 delete statistics;
Now with RBO - the SORT UNIQUE goes away for the above query.
Operation     Object Name     Rows     Bytes     Cost     TQ     In/Out     PStart     PStop
SELECT STATEMENT Hint=CHOOSE                                        
VIEW                                        
UNION-ALL                                        
SORT AGGREGATE                                        
TABLE ACCESS FULL     TAB1                                   
SORT AGGREGATE                                        
TABLE ACCESS FULL     TAB2                                   
SORT AGGREGATE                                        
TABLE ACCESS FULL     TAB3                                   

Similar Messages

  • What is happening here? In FF ok, IE not

    what is happening here? I have a div that is lining up
    horizontally 300px to the right in IE and is pushing out page not
    seeming to abide by the wrapper div it's in. I have tried it with a
    clear and without on the div itself. It is the object that is just
    below the navigation buttons - different navigation -lines up to
    the right in IE
    http://www.marijuanalife.com/medicalmarijuana.html
    an example of where the object should be placed is on the
    home page.

    HOLY INLINE STYLES!!! Yikes!
    ...it looks like your a victim of IE double margin bug. See
    http://www.maxdesign.com.au/presentation/workshop/slide49.htm
    =========================
    And... what I always say:
    "write it for FireFox then hack it for IE."
    Use the right
    DocType
    Validate your Markup
    Validate your CSS
    Why you want to
    validate
    Don't
    use tables for layout

  • ICloud error message on iPhone saying I don't have enough space to store photos when in fact I have 1.5gb free and my photo library on my phone only has 22 photos. What's happening here and how to I fix this?

    I get an error on my iPhone saying that iCloud photo library storage has run out of space and it will stop uploading photos from my phone. However, my iCloud has 1.5gb of free storage and my photo library only has about 22 photos. So, what's happening here?

    Are you using iCloud photo library beta.
    Are any of your photos actually video.

  • What's happening here: iCloud Photos preparing photos for 'Photos' app?

    This morning I came back from a weekend trip to Prague, where I took a number of photos with my iPhone 6. On my Mac I fired up iCloud Photos to see if everything was imported properly. That was about an hour ago. Since then I am presented with this screen, saying something like:
    "Welcome to Photos app. 
    With Photos app you may save your whole iCloud Photo Library ...
    Preparing photos ... This may take a few minutes.
    ... will be continued when you leave iCloud.com."
    However, with Yosemite 10.10.2 I don't have the new Photos app for Mac on my iMac!
    Now what is happening here?

    I even liked Apples error messages , because most of them were so helpful ... But now the smart guys at Apple seem to be following a more obfuscating strategy, at least sometimes.
      I suspect the maintenance work on iCloud Photo Library this weekend has been in preparation for the big life event today - then all will be revealed:   http://www.apple.com/live/

  • Query using views

    Since the query is too big, I have removed the query from the post.
    I would like to know whether using views in SQL queries degrade the performance of the queries?
    When views are used in sql queries, the operation 'FILTER' is displayed in the explain plan, however the cost doesnt seem to be high. If the views can be replaced by the base tables, it is better to do so?
    Edited by: user642116 on Nov 8, 2008 11:13 PM

    user642116 wrote:
    I have a main table called NATURAL_PERSON. There are several child tables based on this table, for e.g. PERSONAL_DETAILS, NATIONALITY_PERSON, CIVIL_STATUS etc. All these child tables have a foreign key NPN_ID which is joined with the ID of NATURAL_PERSON.
    I need to obtain data from these child tables and present in them xmlformat.
    A part of the query used is as below
    SELECT npn.ID npn_id,
    CONVERT(xmlelement("uwvb:NaturalPerson",
              XMLForest(LPAD(npn.nat_nummer,9,0) AS "uwvb:NatNr"),
              (XMLForest(LPAD(per.a_nummer, 10, 0) AS "uwvb:ANr"
              (SELECT XMLFOREST
                        (code_status AS "uwvb:ResidenceStatus")
                        FROM ebv_v_nep nep
                        WHERE npn_id = npn.ID
                        AND nep.nem_code = 'VBT'
                        AND nep.transactid =
                        (SELECT MAX (nep_i.transactid)
                             FROM ebv_v_nep nep_i
                             WHERE nep.npn_id = nep_i.npn_id
                             AND nep_i.nem_code = 'VBT'))
              entityelement),'WE8MSWIN1252', 'UTF8')
    FROM ebv_v_npn npn, ebv_v_per per
    WHERE npn.ID = per.npn_id
    As seen in the above query, views have been defined for all the tables. For e.g. the view ebv_v_npn is based on NATURAL_PERSON, ebv_v_per is based on PERSONAL_DETAILS, ebv_v_nep is based on RESIDENCE STATUS. All these views are independent of each other and do not contain common tables in their definition.
    The views can be replaced by the base tables as i dont see any advantage of using the views. I would like to know whether replacing the views with the base tables would also help to improve the performance.Replacing the views with the base tables might help, since not always Oracle is able to merge the views, so sometimes certain access paths are not available when working with views compared to accessing the base tables directly.
    You can see this in the execution plan if there are separate lines called "VIEW". In this case a view wasn't merged.
    The particular query that you've posted joins two views in the main query and (potentially) executes a scalar subquery that contains another correlated subquery for each row of the result set. "Potentially" due to the cunning "Filter optimization" feature of the Oracle runtime engine that basically attempts to cache the results of scalar subqueries to minimize the number of executions.
    If the statement doesn't perform as expected you need to find out which of the two operations is the main contributor to the statement's runtime.
    You can use DBMS_XPLAN.DISPLAY to find out what the FILTER operation you mentioned is actually performing (check the "Predicates Information" section below the plan output), and you can use SQL tracing to find out which row source generates how many rows. The following document explains how to enable SQL tracing and run the "tkprof" utility on the generated trace file: When your query takes too long ...
    The correlated subquery of the scalar subquery that is used to determine the maximum "transactid" may be replaced with a version of the statement that uses an analytic function to avoid the second access to the view (note: untested):
    SELECT npn.ID npn_id,
      CONVERT(xmlelement("uwvb:NaturalPerson",
              XMLForest(LPAD(npn.nat_nummer,9,0) AS "uwvb:NatNr"),
              (XMLForest(LPAD(per.a_nummer, 10, 0) AS "uwvb:ANr"
              (SELECT XMLFOREST
        (code_status AS "uwvb:ResidenceStatus")
        FROM (
          SELECT code_status,
          RANK() over (PARTITION BY npn_id ORDER BY transactid desc) as rnk
          FROM ebv_v_nep nep
          WHERE nep.npn_id = npn.ID
          AND nep.nem_code = 'VBT'
        where rnk = 1)
        entityelement),'WE8MSWIN1252', 'UTF8')
    FROM ebv_v_npn npn, ebv_v_per per
    WHERE npn.ID = per.npn_idRegards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/
    Edited by: Randolf Geist on Nov 10, 2008 9:27 AM
    Added the rewrite suggestion

  • Someone is getting into my ITunes and purchasing games yet I have no money on the account nor do I use a credit card..what is happening here...I just got advised of the purchase

    Someone is purchasing games from my account yet I have no monies in the account to purchase anything nor do I use a charge card ...what is happening and cs
    an I resolve the issue...

    If you haven't already done so then change your password on your account e.g. by tapping on your id in Settings > iTunes & App Stores on your iPad and logging into your account, via the Store > View Account menu option on your computer's iTunes or via http://appleid.apple.com - if you do it on your computer or that website you might then need to log out (by tapping on your id in Settings > iTunes & App Stores) and back into your account on your iPad so as to 'refresh' the account on it.
    If things have been purchased which you didn't buy, and nobody else has access to your account or devices, then contact iTunes Support : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Purchases, Billing & Redemption

  • Need SQL query using View - Please help

    Hi,
    I have similar requirement like below.
    I have two tables DEPT and EMP and some departments may not have employees. I have created below view, which displays all DEPT records, even though there are no emplyees.
    CREATE OR REPLACE VIEW dept_emp_vw AS
    SELECT deptno, empid, 0 AS selected
    FROM dept d, emp e
    WHERE d.deptno = e.deptnno (+);
    Ex.
    DEPTNO         EMPID        SELECTED
    10 101 0
    10 102 0
    20 103 0
    30 103 0
    40 104 0
    50 <null> 0
    Application will pass "empid" to the view (for ex. empid = 103) and I want result like below.
    Ex.
    DEPTNO         EMPID        SELECTED
    10 101 0
    10 102 0
    20 103 1
    30 103 1
    40 104 0
    50 <null> 0
    Can you please let me know the query using "dept_emp_vw" view. We have Oracle 11g Release 2.
    Thanks a lot for the help.

    Not possible using normal SQL - as SQL is not a procedure language and does not support variable declaration and use (e.g. passing empid as a variable and using it both as a predicate and as a condition in the SQL projection).
    That said - SQL can be "+parameterised+". An approach that is ugly and contrary to the basic design and use of SQL. But it can support the (very weird) view definition of yours.
    E.g.
    SQL> create or replace procedure SetVariable( name varchar2, value varchar2 ) is
      2  begin
      3          DBMS_SESSION.set_context( 'MyVariables', name, value );
      4  end;
      5  /
    Procedure created.
    SQL>
    SQL>
    SQL> create or replace context MyVariables using SetVariable;
    Context created.
    SQL>
    SQL> create or replace view my_funky_weird_view as
      2  select
      3          e.empno,
      4          e.ename,
      5          e.job,
      6          case e.empno
      7                  when to_number(sys_context( 'MyVariables', 'empid' )) then
      8                          0
      9                  else
    10                          1
    11          end     as "SELECTED"
    12  from       emp e
    13  /
    View created.
    SQL>
    SQL> exec SetVariable( 'empid', 7499 )
    PL/SQL procedure successfully completed.
    SQL>
    SQL> select * from session_context where namespace = 'MYVARIABLES';
    NAMESPACE            ATTRIBUTE            VALUE
    MYVARIABLES          EMPID                7499
    SQL>
    SQL> select * from my_funky_weird_view order by selected;
         EMPNO ENAME      JOB               SELECTED
          7499 ALLEN      SALESMAN                 0
          7521 WARD       SALESMAN                 1
          7566 JONES      MANAGER                  1
          7654 MARTIN     SALESMAN                 1
          7698 BLAKE      MANAGER                  1
          7934 MILLER     CLERK                    1
          7788 SCOTT      ANALYST                  1
          7839 KING       PRESIDENT                1
          7844 TURNER     SALESMAN                 1
          7876 ADAMS      CLERK                    1
          7900 JAMES      CLERK                    1
          7902 FORD       ANALYST                  1
          7369 SMITH      CLERK                    1
          7782 CLARK      MANAGER                  1
    14 rows selected.
    SQL>But I will N\OT recommend doing it this way. It is not natural SQL as PL/SQL is needed to "+inject+" name-value pairs into the context for the SQL view to use. It is ugly. It is not standard. It cannot scale. It is complex to use. Etc.
    Yes, there are instances when this approach is exactly what one needs - when for example dealing with a trusted context and using the contents for implementing a security layer. But in the above case - I would rather want to see the actual business requirement first, as I think you're barking up the wrong tree with the view solution you have imagined.

  • Improving performance of query with View

    Hi ,
    I'm working on a stored procedure where certain records have to be eleminated , unfortunately tables involved in this exception query are present in a different database which will lead to performance issue. Is there any way in SQL Server to store this query
    in a view and store it's execution plan and make it work like sp.While I beleive it's kinda crazy thought but is there any better way to improve performance of query when accessed across databases.
    Thanks,
    Vishal.

    Do not try to solve problems that you have not yet confirmed to exist.  There is no general reason why a query (regardless of whether it involves a view) that refers to a table in a different database (NB - DATABASE not INSTANCE) will perform poorly. 
    As a suggestion, write a working query using a duplicate of the table in the current database.  Once it is working, then worry about performance.  Once that is working as efficiently as it can , change the query to use the "remote" table rather
    than the duplicate. Then determine if you have an issue.  If you cannot get the level of performance you desire with a local table, then you most likely have a much larger issue to address.  In that case, perhaps you need to change your perspective
    and approach to accomplishing your goal. 

  • When i hide some fields from the Editform using javascript, what will happen to the fields that hve been hidden

    I am working on an EnterpriseWiki site collection, and when users edit the page properties as follow:-
    then will get all the fields inside the EnterpriseWiki content type as follow:-
    now i want to hide all the fields except the ; Title & Name, so i edit the EditForm and i add the following script:-
    <script>
    $('#formTbl tr').filter(function ()
    return !$(".ms-standardheader", this).text().match(/Name|Title/i);
    }).remove();
    </script>
    so currently when users edit the wiki page properties they can only edit the Name & Title, because the script hide the other fields.
    My question is what will happen to the other values such as the page content, assign to , etc that have been hidden.. I test this and seems that when editing the name and title the other values will not get effected which is what i need, but not sure how
    did SharePoint handle this, i was afraid that hiding the other columns will set their values as null or empty if the user save the editform with only the title and name inside it ? can anyone adivce on this ?

    Hi John,
    From your description, my understanding is that you are worried about the values of some fields
     will been saved as empty if you hide them in EditForm.
    If you hide some fields in EditForm, it means that you could not edit them. These fields’ values will not be changed after editing Title field or Name field. When you click Save button, they will be still the values before changing the Title field or Name
    field.
    Best Regards,
    Vincent Han
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]
    i found this very critical issue with hiding the fields from the edit form, now i wrote the following script inside the edit form , to hide all the fields except the Name
    <script>
    $(document).ready(function(){
    $('#formTbl tr').filter(function () {
    return !$(".ms-standardheader", this).text().match(/Name/i); }).hide();
    $('#ctl00_ctl40_g_6c7d849e_da6b_4138_be9f_b99bde542065_ctl00_ctl02_ctl00_ctl04_c‌ ​tl00_WebPartMaintenancePageLink').hide(); });
    </script>"
    . and now if I submit the editform (which only contain the Name) all the html tables inside the wiki page content will be removed.

  • Recent upgrade from 2 to 4 GB remarkably speeded up my Mac.  However, in last two weeks it has reverted to extremely slow ops, so bad I can hardly get G-mail to open or even navigate within Apple programs.  Anyone know what's happening here?

    My mac was barely creeping along when community evaluation suggested my RAM was maxed out so I upgraded.  Operation speed increased dramatically for about 2-3 weeks and all of a sudden it is back to a crawl.  I can hardly open G-mail and also have problems navigating between Apple programs like opening numbers, etc.  I checked ookla speed tests and am operating around 25 + mbs for downloads and about 10 for uploads.  G-mail error notices state slow problem is due to flaky connectivity.  Nothing new has been added to the computer to account for this slow response. Any suggestions for this performance change?

    1. This procedure is a diagnostic test. It changes nothing, for better or worse, and therefore will not, in itself, solve the problem. But with the aid of the test results, the solution may take a few minutes, instead of hours or days.
    Don't be put off by the complexity of these instructions. The process is much less complicated than the description. You do harder tasks with the computer all the time.
    2. If you don't already have a current backup, back up all data before doing anything else. The backup is necessary on general principle, not because of anything in the test procedure. Backup is always a must, and when you're having any kind of trouble with the computer, you may be at higher than usual risk of losing data, whether you follow these instructions or not.
    There are ways to back up a computer that isn't fully functional. Ask if you need guidance.
    3. Below are instructions to run a UNIX shell script, a type of program. As I wrote above, it changes nothing. It doesn't send or receive any data on the network. All it does is to generate a human-readable report on the state of the computer. That report goes nowhere unless you choose to share it. If you prefer, you can act on it yourself without disclosing the contents to me or anyone else.
    You should be wondering whether you can believe me, and whether it's safe to run a program at the behest of a stranger. In general, no, it's not safe and I don't encourage it.
    In this case, however, there are a couple of ways for you to decide whether the program is safe without having to trust me. First, you can read it. Unlike an application that you download and click to run, it's transparent, so anyone with the necessary skill can verify what it does.
    You may not be able to understand the script yourself. But variations of it have been posted on this website thousands of times over a period of years. The site is hosted by Apple, which does not allow it to be used to distribute harmful software. Any one of the millions of registered users could have read the script and raised the alarm if it was harmful. Then I would not be here now and you would not be reading this message.
    Nevertheless, if you can't satisfy yourself that these instructions are safe, don't follow them. Ask for other options.
    4. Here's a summary of what you need to do, if you choose to proceed:
    ☞ Copy a line of text in this window to the Clipboard.
    ☞ Paste into the window of another application.
    ☞ Wait for the test to run. It usually takes a few minutes.
    ☞ Paste the results, which will have been copied automatically, back into a reply on this page.
    The sequence is: copy, paste, wait, paste again. You don't need to copy a second time. Details follow.
    5. You may have started the computer in "safe" mode. Preferably, these steps should be taken in “normal” mode, under the conditions in which the problem is reproduced. If the system is now in safe mode and works well enough in normal mode to run the test, restart as usual. If you can only test in safe mode, do that.
    6. If you have more than one user, and the one affected by the problem is not an administrator, then please run the test twice: once while logged in as the affected user, and once as an administrator. The results may be different. The user that is created automatically on a new computer when you start it for the first time is an administrator. If you can't log in as an administrator, test as the affected user. Most personal Macs have only one user, and in that case this section doesn’t apply. Don't log in as root.
    7. The script is a single long line, all of which must be selected. You can accomplish this easily by triple-clicking anywhere in the line. The whole line will highlight, though you may not see all of it in the browser window, and you can then copy it. If you try to select the line by dragging across the part you can see, you won't get all of it.
    Triple-click anywhere in the line of text below on this page to select it:
    PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/libexec;clear;cd;p=(Software Hardware Memory Diagnostics Power FireWire Thunderbolt USB Bluetooth SerialATA Extensions Applications Frameworks PrefPane Fonts 1024 85 percent 20480 1 MB/s 25000 ports KiB/s DYLD_INSERT_LIBRARIES\ DYLD_LIBRARY_PATH -86 "` route -n get default|awk '/e:/{print $2}' `" 25 N\\/A down up 102400 25600 recvfrom sendto CFBundleIdentifier 25 25 25 1000 MB 'com.adobe.AAM.Updater-1.0 com.adobe.AAM.Updater-1.0 com.adobe.AdobeCreativeCloud com.adobe.CS4ServiceManager com.adobe.CS5ServiceManager com.adobe.fpsaud com.adobe.SwitchBoard com.adobe.SwitchBoard com.apple.aelwriter com.apple.AirPortBaseStationAgent com.apple.FolderActions.enabled com.apple.installer.osmessagetracing com.apple.mrt.uiagent com.apple.ReportCrash.Self com.apple.rpmuxd com.apple.SafariNotificationAgent com.apple.usbmuxd com.citrixonline.GoToMeeting.G2MUpdate com.google.keystone.agent com.google.keystone.daemon com.microsoft.office.licensing.helper com.oracle.java.Helper-Tool com.oracle.java.JavaUpdateHelper com.oracle.java.JavaUpdateHelper org.macosforge.xquartz.privileged_startx org.macosforge.xquartz.privileged_startx org.macosforge.xquartz.startx' '879294308 4071182229 461455494 3627668074 1083382502 1274181950 1855907737 2758863019 1848501757 464843899 3694147963 1233118628 2456546649 2806998573 2778718105 2636415542 842973933 2051385900 3301885676 891055588 998894468 695903914 1443423563 4136085286 523110921 2883943871 3873345487' 51 5120 files 4 1000 25 5120 -\\t 'PlistBuddy -c Print' );N5=${#p[@]};p[N5]=` networksetup -listnetworkserviceorder|awk ' NR>1 { sub(/^\([0-9]+\) /,"");n=$0;getline;} $NF=="'${p[26]}')" { sub(/.$/,"",$NF);print n;exit;} ' `;f=('\n%s: %s\n' '\n%s\n\n%s\n' '\nRAM details\n%s\n' %s\ %s '%s\n'"${p[50]}"'%s\n' '%s (UID %s) is using %s %s' '\nContents of %s\n   '"${p[50]}"'mod date: %s\n   '"${p[50]}"'checksum: %s\n%s\n' '\n   ...and %s more line(s)\n' );S0() { echo ' { q=$NF+0;$NF="";u=$(NF-1);$(NF-1)="";gsub(/^ +| +$/,"");if(q>='${p[$1]}') printf("'"${f[5]}"'",$0,u,q,"'${p[$2]}'");} ';};s=(' s/[0-9A-Za-z._]+@[0-9A-Za-z.]+\.[0-9A-Za-z]{2,4}/EMAIL/g;/faceb/s/(at\.)[^.]+/\1NAME/g;/\/Shared/!s/(\/Users\/)[^ /]+/\1USER/g;s/[-0-9A-Fa-f]{22,}/UUID/g;' ' s/^ +//;/de: S|[nst]:/p;' ' {sub(/^ +/,"")};/er:/;/y:/&&$2<'${p[46]} ' 1s/://;3,6d;/[my].+:/d;s/^ {4}//;H;${ g;s/\n$//;/s: (E[^m]|[^EO])|x([^08]|02[^F]|8[^0])/p;} ' ' 5h;6{ H;g;/P/!p;} ' ' ($1~/^Cy/&&$3>'${p[47]}')||($1~/^Cond/&&$2!~/^N/) ' ' /:$/{ N;/:.+:/d;s/ *://;b0'$'\n'' };/^ *(V.+ [0N]|Man).+ /{ s/ 0x.... //;s/[()]//g;s/(.+: )(.+)/ (\2)/;H;};$b0'$'\n'' d;:0'$'\n'' x;s/\n\n//;/Apple[ ,]|Genesy|Intel|SMSC/d;s/\n.*//;/\)$/p;' ' s/^.*C/C/;H;${ g;/No th|pms/!p;} ' '/= [^GO]/p' '{$1=""};1' ' /Of/!{ s/^.+is |\.//g;p;} ' ' $0&&!/ / { n++;print;} END { if(n<10) print "com.apple.";} ' ' { sub(/ :/,"");print|"tail -n'${p[48]}'";} ' ' NR==2&&$4<='${p[49]}' { print $4;} ' ' END { $2/=256;if($2>='${p[15]}') print int($2) } ' ' NR!=13{next};{sub(/[+-]$/,"",$NF)};'"`S0 21 22`" 'NR!=2{next}'"`S0 37 17`" ' NR!=5||$8!~/[RW]/{next};{ $(NF-1)=$1;$NF=int($NF/10000000);for(i=1;i<=3;i++){$i="";$(NF-1-i)="";};};'"`S0 19 20`" 's:^:/:p' '/\.kext\/(Contents\/)?Info\.plist$/p' 's/^.{52}(.+) <.+/\1/p' ' /Launch[AD].+\.plist$/ { n++;print;} END { if(n<200) print "/System/";} ' '/\.xpc\/(Contents\/)?Info\.plist$/p' ' NR>1&&!/0x|\.[0-9]+$|com\.apple\.launchctl\.(Aqua|Background|System)$/ { print $3;} ' ' /\.(framew|lproj)|\):/d;/plist:|:.+(Mach|scrip)/s/:.+//p ' '/^root$/p' ' !/^\/[AD]|\/Contents\/.+\/Contents\/|\.prefP/&&/\/(Lib|usr).+\/(.+\.lproj|Contents|Info\.plist|Resources)|\.framework$/ { n++;sub(/\/Info\.plist$/,"");sub(/\/([A-Za-z_]+\.lproj|Contents|Resources|Versions)(\/.+)?/,"");print|"sort|uniq";} END { if(n<1100) print "/System/";} ' '/\.dylib$/p' ' /Temp|emac/{next};/(etc|Preferences|Launch[AD].+)\// { sub(".(/private)?","");n++;print;} END { split("'"${p[41]}"'",b);split("'"${p[42]}"'",c);for(i in b) print b[i]".plist\t"c[i];if(n<500) print "Launch";} ' ' /^\/(Ap|Dev|Inc|Prev)/d;/\.(component|mdimporter|plugin|qlgenerator|saver|wdgt)$/p;' 's/Pr.+n //p' ' BEGIN{FS=":"};{ if($1~/\.kext$/) { s=system("'"${p[51]}"'\\ :OSBundleRequired "$1"/*/I*|grep -q Sa");if(!s) $1=$1" S";if(!$2) $2="N/A";printf("'"${f[4]}"'",$1,$2);        } else print;} ' p '{print $3"\t"$1}' 's/\'$'\t''.+//p' 's/1/On/p' '/Prox.+: [^0]/p' '$2>'${p[43]}'{$2=$2-1;print}' ' BEGIN { i="'${p[26]}'";M1='${p[16]}';M2='${p[18]}';M3='${p[31]}';M4='${p[32]}';} !/^A/{next};/%/ { getline;if($5<M1) a="user "$2"%, system "$4"%";} /disk0/&&$4>M2 { b=$3" ops/s, "$4" blocks/s";} $2==i { if(c) { d=$3+$4+$5+$6;next;};if($4>M3||$6>M4) c=int($4/1024)" in, "int($6/1024)" out";} END { if(a) print "CPU: "a;if(b) print "I/O: "b;if(c) print "Net: "c" (KiB/s)";if(d) print "Net errors: "d" packets/s";} ' ' /r\[0\] /&&$NF!~/^1(0|72\.(1[6-9]|2[0-9]|3[0-1])|92\.168)\./ { print $NF;exit;} ' ' !/^T/ { printf "(static)";exit;} ' '/apsd|BKAg|OpenD/!s/:.+//p' ' (/k:/&& $3!~/(255\.){3}0/)||(/v6:/&&$2!~/A/) ' ' $1~"lR"&&$2<='${p[25]}';$1~"li"&&$3!~"wpa2";' ' BEGIN { FS=":";p="uniq -c|sed -E '"'s/ +\\([0-9]+\\)\\(.+\\)/\\\2 x\\\1/;s/x1$//'"'";} { n=split($3,a,".");sub(/_2[01].+/,"",$3);print $2" "$3" "a[n]$1|p;b=b$1;} END { close(p);if(b) print("\n\t* Code injection");} ' ' NR!=4{next} {$NF/=10240} '"`S0 27 23`" ' END { if($3~/[0-9]/)print$3;} ' ' BEGIN { L='${p[36]}';} !/^[[:space:]]*(#.*)?$/ { l++;if(l<=L) f=f"\n   "$0;} END { F=FILENAME;if(!F) exit;if(!f) f="\n   [N/A]";"cksum "F|getline C;split(C, A);C=A[1];"stat -f%Sm "F|getline D;"file -b "F|getline T;if(T~/^Apple b/) { f="";l=0;while("'"${p[51]}"' "F|getline g) { l++;if(l<=L) f=f"\n   "g;};};if(T!~/^(AS.+ (En.+ )?text(, with v.+)?$|(Bo|PO).+ sh.+ text ex|XM)/) F=F"\n   '"${p[50]}"'"T;printf("'"${f[6]}"'",F,D,C,f);if(l>L) printf("'"${f[7]}"'",l-L);} ' ' s/^ ?n...://p;s/^ ?p...:/-'$'\t''/p;' 's/0/Off/p' ' END{print NR} ' ' /id: N|te: Y/{i++} END{print i} ' ' / / { print "'"${p[28]}"'";exit;};1;' '/ en/!s/\.//p' ' NR!=13{next};{sub(/[+-M]$/,"",$NF)};'"`S0 39 40`" ' $10~/\(L/&&$9!~"localhost" { sub(/.+:/,"",$9);print $1": "$9|"sort|uniq";} ' '/^ +r/s/.+"(.+)".+/\1/p' 's/(.+\.wdgt)\/(Contents\/)?Info\.plist$/\1/p' 's/^.+\/(.+)\.wdgt$/\1/p' ' /l: /{ /DVD/d;s/.+: //;b0'$'\n'' };/s: /{ /V/d;s/^ */- /;H;};$b0'$'\n'' d;:0'$'\n'' x;/APPLE [^:]+$/d;p;' ' /^find: /d;p;' "`S0 44 45`" ' BEGIN{FS="= "} /Path/{print $2} ' ' /^ *$/d;s/^ */   /;' ' s/^.+ |\(.+\)$//g;p ' '/\.(appex|pluginkit)\/Contents\/Info\.plist$/p' ' /2/{print "WARN"};/4/{print "CRITICAL"};' ' /EVHF|MACR|^s/d;s/^.+: //p;' ' $3~/^[1-9][0-9]{0,2}(\.[1-9][0-9]{0,2}){2}$/ { i++;n=n"\n"$1"\t"$3;} END { if(i>1) print n;} ' ' s/:[^:]+$//;s/ +([0-9]+)(.+)/\2: \1/p;' ' { gsub(/[()"]/,"",$3);if(!$3) $3="N/A";print $3;} ' ' /es: ./{ s/^.+://;b0'$'\n'' };/^ +C.+ted: +[NY]/H;/:$/b0'$'\n'' d;:0'$'\n'' x;/: +N/d;s/\n.+//p;' ' 1d;/:$/b0'$'\n'' $b0'$'\n'' /(D|^ *Loc.+): /{ s/^.+: //;H;};/(By|m): /H;d;:0'$'\n'' x;/[my]: [AM]|^\/Vo/d;s/(^|\n) [ -~]+//g;s/(.+)\n(.+)/\2:\1/;s/\n//g;/[ -~]/p;' );c1=(system_profiler pmset\ -g nvram fdesetup find syslog df vm_stat sar ps crontab iotop top pkgutil 'PlistBuddy 2>&1 -c Print\' whoami cksum kextstat launchctl smcDiagnose sysctl\ -n defaults\ read stat lsbom 'mdfind -onlyin /' ' for i in ${p[24]};do ${c1[18]} ${c2[27]} $i;done;' pluginkit scutil dtrace profiles sed\ -En awk /S*/*/P*/*/*/C*/*/airport networksetup mdutil lsof test osascript\ -e netstat mdls kextfind );S1() { printf kMDItemContentTypeTree=com.apple.$1;};S2() { printf 'L*/Ca*/com.ap*.Saf*/E*/* -d 1 -name In*t -exec '"${c1[14]}"' :'$1' {} \;|uniq';};c2=(com.apple.loginwindow\ LoginHook ' /L*/P*/loginw*' "'tell app \"System Events\" to get properties of login items'|tr , \\\n" "`S2 CFBundleDisplayName`" '~ $TMPDIR.. \( -flags +sappnd,schg,uappnd,uchg -o ! -user $UID -o ! -perm -600 \)' '-F \$Message -k Sender kernel -k Message CSeq "I/O e"|sort|uniq -c' :${p[35]} :Label '{/,}L*/{Con,Pref}* -type f ! -size 0 -name *.plist -exec plutil -s {} \;' "-f'%N: %l' Desktop L*/Keyc*" therm sysload boot-args status " -F '\$Time \$(RefProc): \$Message' -k Sender Req 'fsev|kern|launchd' -k RefProc Rne 'Aq|WebK' -k Message Rne '08012|Goog|ksadm|probe|Roame|SMC:|smcD|sserti|suhel| VALI|ver-r|xpma' -k Message Req 'abn|bad |Beac|caug|corru|dead[^bl]|FAIL|fail|GPU |hfs: Ru|idle ex|inval|jnl:|last value [1-9]|NVDA\(|pagin|pci pa|proc: t|Roamed|rror|SL|TCON|Throttli|tim(ed? ?|ing )o|WARN' " '-du -n DEV -n EDEV 1 10' 'acrx -o comm,ruid,%cpu' '-t1 10 1' '-f -pfc /var/db/r*/com.apple.*.{BS,Bas,Es,J,OSXU,Rem,up}*.bom' '{/,}L*/Lo*/Diag* -type f -regex .\*[cght] ! -name .?\* ! -name \*ag \( -exec grep -lq "^Thread c" {} \; -exec printf \* \; -o -true \) -execdir stat -f:%Sc:%N -t%F {} \;|sort -t: -k2 |tail -n'${p[38]} '/S*/*/Ca*/*xpc* >&- ||echo No' '-L /{S*/,}L*/StartupItems -type f -exec file {} +' "`S1 bundle`" "`S1 mach-o-dylib`" "`S2 ${p[35]}`" "/e*/{auto,{cron,fs}tab,hosts,{[lp],sy}*.conf,mach_i*/*,pam.d/*,ssh{,d}_config,*.local} {,/usr/local}/etc/periodic/*/* /L*/P*{,/*}/com.a*.{Bo,sec*.ap}*t {/S*/,/,}L*/Lau*/*t .launchd.conf" list getenv /Library/Preferences/com.apple.alf\ globalstate --proxy '-n get default' -I --dns -getdnsservers\ "${p[N5]}" -getinfo\ "${p[N5]}" -P -m\ / '' -n1 '-R -l1 -n1 -o prt -stats command,uid,prt' '--regexp --files com.apple.pkg.*|sort|uniq' -kl -l -s\ / '-R -l1 -n1 -o mem -stats command,uid,mem' '+c0 -i4TCP:0-1023' com.apple.dashboard\ layer-gadgets '-d /L*/Mana*/$USER&&echo On' '-app Safari WebKitDNSPrefetchingEnabled' "+c0 -l|awk '{print(\$1,\$3)}'|sort|uniq -c|sort -n|tail -1|awk '{print(\$2,\$3,\$1)}'" -m 'L*/{Con*/*/Data/L*/,}Pref* -type f -size 0c -name *.plist.???????|wc -l' kern.memorystatus_vm_pressure_level '3>&1 >&- 2>&3' " -F '\$Time \$Message' -k Sender kernel -k Message CSeq 'n Cause: -' " -i '-app Safari UserStyleSheetEnabled' -name\ kMDItem${p[35]} '-nl -print -print-diagnostics' );N1=${#c2[@]};for j in {0..14};do c2[N1+j]=SP${p[j]}DataType;done;N2=${#c2[@]};for j in 0 1;do c2[N2+j]="-n ' syscall::'${p[33+j]}':return { @out[execname,uid]=sum(arg0) } tick-10sec { trunc(@out,1);exit(0);} '";done;l=(Restricted\ files I/O\ errors 'Elapsed time (s)' POST Battery Safari\ extensions Bad\ plists 'High file counts' User Heat System\ load boot\ args FileVault Diagnostic\ reports Log 'Free space (MiB)' 'Swap (MiB)' Activity 'CPU per process' Login\ hook 'I/O per process' Mach\ ports kexts Daemons Agents XPC\ cache Startup\ items Admin\ access Root\ access Bundles dylibs Stylesheet Font\ issues Inserted\ dylibs Firewall Proxies DNS TCP/IP Wi-Fi Profiles Root\ crontab User\ crontab 'Global login items' 'User login items' Spotlight Memory Listeners Widgets Parental\ Controls Prefetching Nets Descriptors App\ extensions Lockfiles Memory\ pressure SMC Shutdowns Bad\ kexts );N3=${#l[@]};for i in {0..8};do l[N3+i]=${p[5+i]};done;N4=${#l[@]};for j in 0 1;do l[N4+j]="Current ${p[29+j]}stream data";done;A0() { Q=5;v[2]=1;id -G|grep -qw 80;v[1]=$?;((v[1]))||{ Q=7;sudo true;v[2]=$?;((v[2]))||Q=8;};v[3]=`date +%s`;clear >&-;date '+Start time: %T %D%n';};for i in 0 1;do eval ' A'$((1+i))'() { v=` eval "${c1[$1]} ${c2[$2]}"|'${c1[30+i]}' "${s[$3]}" `;[[ "$v" ]];};A'$((3+i))'() { v=` while read i;do [[ "$i" ]]&&eval "${c1[$1]} ${c2[$2]}" \"$i\"|'${c1[30+i]}' "${s[$3]}";done<<<"${v[$4]}" `;[[ "$v" ]];};A'$((5+i))'() { v=` while read i;do '${c1[30+i]}' "${s[$1]}" "$i";done<<<"${v[$2]}" `;[[ "$v" ]];};A'$((7+i))'() { v=` eval sudo "${c1[$1]} ${c2[$2]}"|'${c1[30+i]}' "${s[$3]}" `;[[ "$v" ]];};';done;A9(){ v=$((`date +%s`-v[3]));};B2(){ v[$1]="$v";};for i in 0 1;do eval ' B'$i'() { v=No;((v['$((i+1))']==0))&&v=;};B'$((3+i))'() { v[$2]=`'${c1[30+i]}' "${s[$3]}"<<<"${v[$1]}"`;} ';done;B5(){ v[$1]="${v[$1]}"$'\n'"${v[$2]}";};B6() { v=` paste -d: <(printf "${v[$1]}") <(printf "${v[$2]}")|awk -F: ' {printf("'"${f[$3]}"'",$1,$2)} ' `;};B7(){ v=`grep -Fv "${v[$1]}"<<<"$v"|sort`;};C0() { [[ "$v" ]]&&sed -E "$s"<<<"$v";};C1() { [[ "$v" ]]&&printf "${f[$1]}" "${l[$2]}" "$v"|sed -E "$s";};C2() { v=`echo $v`;[[ "$v" != 0 ]]&&C1 0 $1;};C3() { v=`sed -E "${s[63]}"<<<"$v"`&&C1 1 $1;};C4() { echo "Part $((++P)) of $Q done at $((`date +%s`-v[3])) sec">&4;};for i in 1 2 7 8;do for j in 0 2 3;do eval D$i$j'(){ A'$i' $1 $2 $3; C'$j' $4;};';done;done;{ A0;D20 0 $((N1+1)) 2;D10 0 $N1 1;B0;C2 27;B0&&! B1&&C2 28;D12 15 37 25 8;A1 0 $((N1+2)) 3;C0;D13 0 $((N1+3)) 4 3;D23 0 $((N1+4)) 5 4;D13 0 $((N1+9)) 59 $((N3+4));for i in 0 1 2;do D13 0 $((N1+5+i)) 6 $((N3+i));done;D13 0 $((N1+8)) 71 $((N3+3));D13 1 10 7 9;D13 1 11 8 10;B1&&D73 19 53 67 55;D22 2 12 9 11;D12 3 13 10 12;D23 4 19 44 13;B0&&{ D13 5 5 69 1;D13 5 54 30 56;C4;D23 5 14 12 14;C4;};D22 6 36 13 15;D22 20 52 66 54;D22 7 37 14 16;D23 8 15 38 17;D22 9 16 16 18;C4;B1&&{ D82 35 49 61 51;D82 11 17 17 20;for i in 0 1;do D82 28 $((N2+i)) 45 $((N4+i));done;C4;};D22 12 44 54 45;D22 12 39 15 21;D13 40 58 32 57;A1 13 40 18;B2 4;B3 4 0 19;A3 14 6 32 0;B4 0 5 11;C4;A1 17 41 20;B7 5;C3 22;B4 4 6 21;A3 14 7 32 6;B4 0 7 11;B3 4 0 22;A3 14 6 32 0;B4 0 8 11;B5 7 8;B1&&{ A8 18 26 23;B7 7;C3 23;};A2 18 26 23;B7 7;C3 24;D13 4 21 24 26;B4 4 12 26;C4;for i in {0..3};do A1 0 $((N1+10+i)) 72;B7 12;B4 0 0 31;((i))&&{ B2 14;A4 39 57 70 14;B2 15;B6 14 15 4;};C3 $((N3+5+i));done;A1 24 22 29;B7 12;B2 14;A4 39 57 70 0;B2 15;B6 14 15 4;C3 29;C4;B3 4 13 27;A1 24 23 32;B7 13;C3 30;B3 4 0 65;A3 14 6 32 0;B4 0 16 11;A1 26 50 64;B7 16;C3 52;D13 25 37 32 33;A2 23 18 28;B2 16;A2 16 25 33;B7 16;B3 0 0 34;B2 21;A6 47 21&&C0;B1&&{ D73 21 0 32 19;D73 10 42 32 40;D82 29 35 46 39;};D23 14 1 62 42;D12 34 43 53 44;D12 22 20 32 25;D22 0 $((N1+14)) 51 32;D13 4 8 41 6;D12 21 28 35 34;D13 27 29 36 35;A2 27 32 39&&{ B2 19;A2 33 33 40;B2 20;B6 19 20 3;};C2 36;D23 38 55 68 50;D23 33 34 42 37;B1&&D83 35 45 55 46;D23 32 31 43 38;D12 36 47 32 48;D13 10 42 32 41;D13 37 2 48 43;A1 4 3 60;B2 30;A1 4 24 60;B2 31;B6 30 31 4;C3 5;D12 21 56 35 31;D12 21 48 49 49;B3 4 22 57;A1 21 46 56;B7 22;B3 0 0 58;C3 47;D22 4 4 50 0;D12 4 51 32 53;D23 22 9 37 7;A9;C2 2;C4;} 4>&2 2>/dev/null|pbcopy;exit 2>&-
    Copy the selected text to the Clipboard by pressing the key combination command-C.
    8. Launch the built-in Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad and start typing the name.
    Click anywhere in the Terminal window and paste by pressing command-V. The text you pasted should vanish immediately. If it doesn't, press the return key.
    9. If you see an error message in the Terminal window such as "Syntax error" or "Event not found," enter
    exec bash
    and press return. Then paste the script again.
    10. If you're logged in as an administrator, you'll be prompted for your login password. Nothing will be displayed when you type it. You will not see the usual dots in place of typed characters. Make sure caps lock is off. Type carefully and then press return. You may get a one-time warning to be careful. If you make three failed attempts to enter the password, the test will run anyway, but it will produce less information. In most cases, the difference is not important. If you don't know the password, or if you prefer not to enter it, press the key combination control-C or just press return  three times at the password prompt. Again, the script will still run.
    If you're not logged in as an administrator, you won't be prompted for a password. The test will still run. It just won't do anything that requires administrator privileges.
    11. The test may take a few minutes to run, depending on how many files you have and the speed of the computer. A computer that's abnormally slow may take longer to run the test. While it's running, there will be a series of messages in the Terminal window like this:
    Part 1 of 8 done at … sec
    Part 8 of 8 done at … sec
    The messages won't be spaced equally apart in time, but they give a rough indication of progress. The total number of parts may be different from what's shown here.
    Wait for the final message
    [Process completed]
    to appear. If you don't see it within half an hour or so, the test probably won't complete in a reasonable time. In that case, close the Terminal window and report the last message you saw. No harm will be done.
    12. When the test is complete, quit Terminal. The results will have been copied to the Clipboard automatically. They are not shown in the Terminal window. Please don't copy anything from there. All you have to do is start a reply to this comment and then paste by pressing command-V again.
    At the top of the results, there will be a line that begins with the words "Start time." If you don't see that, but instead see a mass of gibberish, you didn't wait for the "Process completed" message to appear in the Terminal window. Please wait for it and try again.
    If any private information, such as your name or email address, appears in the results, anonymize it before posting. Usually that won't be necessary.
    13. When you post the results, you might see an error message on the web page: "You have included content in your post that is not permitted," or "You are not authorized to post." That's a bug in the forum software. Please post the test results on Pastebin, then post a link here to the page you created.
    14. This is a public forum, and others may give you advice based on the results of the test. They speak only for themselves, and I don't necessarily agree with them.
    Copyright © 2014 by Linc Davis. As the sole author of this work, I reserve all rights to it except as provided in the Use Agreement for the Apple Support Communities website ("ASC"). Readers of ASC may copy it for their own personal use. Neither the whole nor any part may be redistributed.

  • Too many problems with Firefox... my company asking to convert to Chrome! What's happening here folks?

    Firefox for OS X is rapidly losing favor within my company - the FF browser is getting too unreliable (freezes & crashes), non-intuitive/complicated for configuration, and loses configurations/settings with its MANY updates.
    People are liking Chrome & Safari more and more - but I LOVE FF because its 100% CSS compliant.
    What's happening to my favorite browser??

    Hi, what problems exactly are you having that you're looking for help for?
    People in an enterprise situation might consider using [http://www.mozilla.org/en-US/firefox/organizations/ Firefox ESR], which updates much less frequently as regular Firefox and as such is supported for much longer periods of time.

  • Slow query using view on cube

    I have created a cube using Analytic workspace manager (oracle 10G R2) which is to be used (via a view) in OBIEE.
    One of the dimensions (event_dim) is extremely sparse (it has been marked as sparse and is at the appropriate level in the cube's dimensional hierarchy).
    In general, when I query the cube (via the view) at high levels of aggregation, the performance is good, but when I query the cube at the lowest level of granulrity for the event_dim dimension, the performance is extremely poor (more than a minute to return).
    The problem seems to be that the view is returning data for all possible rows in the cube even if most of the measures are NA (i.e null since there is no data present).
    For example if I run a query against the cube with no filter on the measures I get around 20,000 rows returned - obviously this takes a while. If I then put a 'my_measure > 0' clause on the query I get 2 rows back (which is correct). However this still takes more than a minute to return - I assume that this is because the query is having to process the 20,000 rows to find the two that actually have data.
    Is there any way to control this - I never need to see the NA data so would like to be able to disable this in either the cube or the view - and hence improve performance.
    Note: I cannot use the compression option since I need to be able to override the default aggregation plan for certain dimension/measure combinations and it appears that compression and overriding the plan are incompatible (AWM gives the error "Default Aggregation Plan for Cube is required when creating cube with the Compression option").
    Thanks,
    Chris

    I have seen this in some examples/mails. I havent tried it out myself :)
    Try using a OLAP_CONDITION filter with an appropriate entry point option (1) on the OLAP_TABLE based query and achieve the goal of restricting output from query to value with meas > 0. This condition can be added as part of a specific query or as part of the OLAP_TABLE view definition (applicable to all queries). Hopefully this way there is no need to customize the limitmap variable to suit the cube implementation internal details like compression, partitioning, presummarization, global composite etc.
    NOTE1: The olap_condition entry point 1 pushes the measure based dimension filter within the cube before fetching results from cube. Hopefully this will help speed up the retrieval of results. This should work well if we want the restriction to apply across 1 dimension.. Time or Product alone.. only 1 olap_condition is sufficient.
    SELECT ...
    FROM <olap_table_based_view>
    where ...
    and olap_condition(olap_calc, ' limit time KEEP sales_sales > 0', 1)=1
    --and olap_condition(olap_calc, ' limit time KEEP any(sales_sales, product) > 0', 1)=1
    NOTE2:
    For cases where both time and product (and more dimensions) need to be restricted then we can use 2 olap_conditions to restrict data to set of time and products where some data exists but you could still end up with a specific row (cross combination of product and time) with zero value. You may want to bolster the pre-fetch filtering by olap_condition via a regular sql filter referencing the external measure column (and sales_view_col >0) which is applied on to the results after it is fetched from the cube.
    E.g:
    SELECT ...
    FROM <olap_table_based_view>
    where ...
    and olap_condition(olap_calc, ' limit product KEEP any(sales_sales, time) > 0', 1)=1
    and olap_condition(olap_calc, ' limit time KEEP any(sales_sales, product) > 0', 1)=1
    and sales_view_col >0
    HTH
    Shankar

  • Ora-13226 when performing spatial query on view

    Hi,
    in my database I have a view with spatial column. The view is based on UNION ALL select. When I try to run spatial query on the view, the database returns ora-13226 error. When I recreate the view to consist only one select (without UNION ALL) the spatial query return correct result. Could you pls help me how to do a spatial query on spatial view whose definition contains UNION ALL select?
    Thanks
    Andrew

    Hi,
    it's quite simple:
    create view test_view as
    select id, geometry from table_a
    union all
    select id, geometry from table_b;
    When I try for example:
    select *
    from test_view
    where sdo_relate(geometry, (select geometry from table_c where id=1316),'mask=anyinteract') = 'TRUE';
    it throws ora-13226 error.
    Interesting is that following query where the geometry is directly included runs well:
    select *
    from test_view
    where sdo_relate(geometry, MDSYS.SDO_GEOMETRY (....),'mask=anyinteract') = 'TRUE';
    also when I recreate the test_view as
    create view test_view as
    select id, geometry from table_a;
    then also the first query (with inner select) returns no error.
    It's a little bit strange isn't it?
    Andrew

  • HELP! Query Using View to denormalize data

    Help!!!
    Below are two logical records of data that have been denormalized so that each column is represented as a different record in the database
    RECORD NUMBER, COL POSITION, VALUE
    1, 1, John
    1, 2, Doe
    1, 3, 123 Nowhere Lake
    1, 4, Tallahassee
    1, 5, FL
    2, 1, Mary
    2, 2, Jane
    2, 3, 21 Shelby Lane
    2, 4, Indianapolis
    2, 5, IN
    I need to write a view to return the data values in this format:
    John, Doe, 123 Nowhere Lake, Tallahassee, FL
    Mary, Jane, 21 Shelby Lane, Indianapolis, IN
    I REALLY need this as soon as possible! Someone PLEASE come to my rescue!!!

    Assuming that the other table has one record per record_num in the first table, then you could do something like:
    SQL> SELECT * FROM t1;
    RECORD_NUM DATE_COL
             1 17-MAR-05
             2 16-MAR-05
    SQL> SELECT a.record_num, col1, col2, col3, col4, col5, t1.date_col
      2  FROM (SELECT record_num,
      3               MAX(DECODE(col_position, 1, value)) Col1,
      4               MAX(DECODE(col_position, 2, value)) Col2,
      5               MAX(DECODE(col_position, 3, value)) Col3,
      6               MAX(DECODE(col_position, 4, value)) Col4,
      7               MAX(DECODE(col_position, 5, value)) Col5
      8        FROM t
      9        GROUP BY record_num) a, t1
    10  WHERE a.record_num = t1.record_num;
    RECORD_NUM COL1  COL2  COL3              COL4            COL5  DATE_COL
             1 John  Doe   123 Nowhere Lake  Tallahassee     FL    17-MAR-05
             2 Mary  Jane  21 Shelby Lane    Indianapolis    IN    16-MAR-05If your second table is structured like the first table then something more like:
    SELECT record_num,
           MAX(DECODE(source,'Tab1',DECODE(col_position, 1, value))) Col1,
           MAX(DECODE(source,'Tab1',DECODE(col_position, 2, value))) Col2,
           MAX(DECODE(source,'Tab1',DECODE(col_position, 3, value))) Col3,
           MAX(DECODE(source,'Tab1',DECODE(col_position, 4, value))) Col4,
           MAX(DECODE(source,'Tab1',DECODE(col_position, 5, value))) Col5,
           MAX(DECODE(source,'Tab2',DECODE(col_position, 1, value))) T2_Col1,
           MAX(DECODE(source,'Tab2',DECODE(col_position, 2, value))) T2_Col2
    FROM (SELECT 'Tab1' source, record_num, col_position, value
          FROM t
          UNION ALL
          SELECT 'Tab2' source, record_num, col_position, value
          FROM t1)
    GROUP BY record_numBy the way, I can't say I am enamoured of your data model.
    John

  • Rented a movie on iTunes, still had 27 days till it expired but when loaded it to watch, said it had expired. Was not able to watch movie on trip. Later on, came back as being able to watch movie. What is happening here?

    I have an iPad 2. So does my wife. We recently went on a trip and downloaded movies to watch on the plane. My wife watched 3/4 of her movie and then fell asleep for an hour. When she went back to watch the remaining last quarter of the movie, it said it had expired. It also said that all the other movies that she had downloaded within the past 2-3 days had expired. I had a similar problem with a movie I rented. I went to view it and it came up and said it couldn't load the content and then said the movie had expired. I wasn't able to watch the movie on my flight which was quite annoying. Since returning home later in the day, I still had it saying it was expired, but now it is coming back and saying I have 27 days (which is correct). What is going on here? Someone at the apple store in NYC said to close the app but I find I don't even know how to do that anymore with the new version. Used to be you double clicked on the button and then got a minus sign which allowed you to close the app. It doesn't do that anymore. I also tried turning the iPad off for at least 5 minutes and trying it again and that didn't work either. Anyone else had this problem? Can anyone tell me why this is happening?

    force quit app.  double click home button and slide app up and off page
    Peace, Clyde

Maybe you are looking for

  • HT201299 Apps in Green in 'use cellular data for..' cannot be turned off?

    Why does an app in 'use cellular data for..' keeps on going to Green eventhough I already swiped it off? It keeps coming back.

  • Screen resolution on 2. monitor - G580

    Have Lenovo G580 with max resolution on the PC screen of 1366 X 768. Second monitor (Acer S201HL) has max resolution of 1600 X 900. Can only get 1024 X 768. No option higher or lower. Would at least like 1366 x 768 ?? Have added the higher resolution

  • BIG Problem with generating multiple pdfs

    Hi, I have an application for which the final output is a pdf report about an applicant from a database of applicants. If I print the form just once, all the stylesheet formatting is applied correctly. If I try to loop through the database and genera

  • Security and WIFI software for android tablet pcs

    Are there any plans to develop a security package for android tablet PCs?  Would my VISS software work on my android tablet?  I have the same question about the WIFI client that allows you to search for Verizon hotspots.  Are there any plans to devel

  • ? about persistent indicator and use of nav tag

    Hi, I have read Nancy O's informative article on persistent indicators.  I think I have everything almost working.  However, I get some errors when I validate on W3C validation service. The errors I get are: Line 22, Column 23: document type does not