Select on view is long - Select on view definition short.

Greetings Everyone -
There is a view in Oracle called V$LOCK.
If I do a count or a select on this view I get a result in *45 seconds*.
There are only 77 records.
However - If I do a select or a count on the view definition (found in V$FIXED_VIEW_DEFINITION)
I get a result in no time. Immediately.
I am signed in accordingly 'sqlplus / as sysdba'
What's going on ??? My feable brain cannot comprehend!!!
Thanks for any help,
BB

>
There is a view in Oracle called V$LOCK.
>
On 11.2 that is not correct. A query of 'select * from dba_synonyms where synonym_name like '%LOCK%' shows
V$_LOCK => V_$_LOCK
V$LOCK => V_LOCK
GV$_LOCK => GV_$_LOCK
GV$LOCK => GV_$LOCK
And a query of 'SELECT * FROM DBA_OBJECTS WHERE OBJECT_NAME LIKE '%LOCK%' shows
GV_$LOCK => VIEW
GV_$_LOCK => VIEW
V_$LOCK => VIEW
V_$_LOCK => VIEW
So V$LOCK is a synonym. And you may be querying the correct underlying view for each of your queries but sometimes the queries may not be on the view that you think they are.
>
If I do a count or a select on this view I get a result in 45 seconds.
There are only 77 records.
However - If I do a select or a count on the view definition (found in V$FIXED_VIEW_DEFINITION)
I get a result in no time. Immediately.
>
Let's see the first time you query data (when maybe there is nothing in the cache) it is slower than the second time you query the same data (when maby there is something in the cache)?
That isn't unusual.
>
Well - that is interesting. Still it took you 11 seconds for 15 records !!!
>
Records? There aren't any 'records'. The V$s are 'dynamic' performance views not tables. And read consistency is not guaranteed for them. The data is continuously updated so if there are no updates the view data won't change and depending on the updated data the view data may barely change.
It is unlikely that the data changed much, if at all, between your two queries.
See 'About Dynamic Performance Views' in the Database doc
http://docs.oracle.com/cd/B28359_01/server.111/b28320/dynviews_1001.htm#i1398692
>
Oracle contains a set of underlying views that are maintained by the database server and accessible to the database administrator user SYS. These views are called dynamic performance views because they are continuously updated while a database is open and in use, and their contents relate primarily to performance.
Although these views appear to be regular database tables, they are not. These views provide data on internal disk structures and memory structures.
You can select from these views, but you can never update or alter them.
>
And see the NOTE just below (as well as the section that discuss the V$ and GV$ views
>
Because the information in the V$ views is dynamic, read consistency is not guaranteed for SELECT operations on these views.

Similar Messages

  • Long delay selecting Application or Document in Finder column view.

    MacBook
    OS 10.4.11
    In the Finder in column view when I select an application or a document (folders are fine) the rainbow pinwheel comes up and it takes a minute or two to show the item in the preview pane. Once there it works.
    Also, when I am in an App like MAIL and I want to attach a file to an email I encounter the same delay when I navigate to the item I want to attach.
    This all began when I bought and installed Final Cut Express and did all the recommended software updates from SOFTWARE UPDATE.
    On a related note, FCE has an odd little bug that makes the first few frames of a clip solid green. Not sure if that's related or not.
    So there you have it. As far as I can tell I've installed everything properly and SOFTWARE UPDATE says I'm good to go.
    Your help is appreciated.

    Hi brudly, and a warm welcome to the forums!
    Could be many things, we should start with this...
    "Try Disk Utility
    1. Insert the Mac OS X Install disc that came with your computer, then restart the computer while holding the C key.
    2. When your computer finishes starting up from the disc, choose Disk Utility from the Installer menu. (In Mac OS X 10.4 or later, you must select your language first.)
    *Important: Do not click Continue in the first screen of the Installer. If you do, you must restart from the disc again to access Disk Utility.*
    3. Click the First Aid tab.
    4. Click the disclosure triangle to the left of the hard drive icon to display the names of your hard disk volumes and partitions.
    5. Select your Mac OS X volume.
    6. Click Repair. Disk Utility checks and repairs the disk."
    http://docs.info.apple.com/article.html?artnum=106214
    Then Safe Boot, (holding Shift key down at bootup), run Disk Utility in Applications>Utilities, then highlight your drive, click on Repair Permissions, reboot when it completes.
    The usual reason why updates fail or mess things up, is if Permissions are not fixed before & after every update, with a reboot... you may get a partial update when the installer finds it doesn't have Permissions to change one obscure little part of the OS, leaving you with a mix of OS versions.
    Some people get away without Repairing Permissions for years, some for only days.
    If Permissions are wrong before applying an update, you could get mixed OS versions, if Directory is the slightest messed up, who knows!
    If many Permission are repaired, or any Directory errors are found, you may need to re-apply some the latest/biggest updates.

  • How to create a triangle view with a select query?

    I need help to build a select query that will create a triangle view.
    Below is the table I have to query
    *{color:#ff0000}INITIAL TABLE{color}*
    *{color:#008000}AMOUNT | TRANSACTION_DATE | OPEN_DATE | TYPE{color}*
    5 | 30-JAN-09 | 10-JAN-09 | A
    10 | 12-JAN - 09 | 30-NOV-08 | A
    20 | 30 - DEC - 08 | 15-OCT-08 | A
    10 | 30 - DEC - 08 | 8 - OCT - 08 | A
    *{color:#ff0000}THE FINAL TABLE I HAVE TO CREATE:{color}*
    DEV_PERIOD - TO_CHAR(TRUNC(TRANSACTION_DATE,'Q'),'YYYY-Q') AS DEV_PERIOD
    OPEN PERIOD - TO_CHAR(TRUNC(OPEN_DATE,'Q'),'YYYY-Q') AS OPEN_PERIOD
    {color:#008000}*SUM of AMOUNT | DEV_PERIOD | OPEN_PERIOD | TYPE*{color}
    5 | 2009 - 1 | 2009 - 1 | A
    40 | 2009 - 1 | 2008 - 4 | A
    30 | 2008 - 4 | 2008 - 4 | A
    {color:#ff0000}*This is another view of the table (The triangle view)*{color}
    | Dev_Period 2008- 1 | 2008 - 2| 2008 -3 | 2008 - 4 | 2009 -1 |
    Open_Period |
    2008 - 1..................... 0.......... 0............ 0........... 0.......... 0
    2008 - 2 ..................................0............ 0........... 0.......... 0
    2008 - 3................................................. 0........... 0.......... 0
    2008 - 4 ..............................................................30......... 40
    2009 - 1 .............................................................................5
    Any ideas will be appreaciated.
    Thank you!

    I think the first thing you need to do is look up "pivot query" in this newsgroup. And how complicated your query gets to be will depend on your database version (11 natively supports pivot queries). You have a variable number of columns in your result set (depending on how many quarters you have in your data.
    I think once you get the columns sorted out, working out the numbers to put in each column will be relatively easy.
    Jon

  • HOW TO GET THE SELECTED VALUE IN A ROW FROM ONE VIEW TO ANOTHER VIEW?

    hi all,
    I  have a small issue.
    i have created two views.In the table of the first view i'm selecting a row and pressing the button it will move to next view.
    i am adding some fields manually in the table of the second view and pressing the save button.Here all the values should get updated corresponding to the field which i have selected in the first view.
    I want to know how to get the particular field in the selected row from one view to another view.
    Kindly help me.

    Hi,
            Any data sharing accross views can be achiveved by defining CONTEXT data in COMPONENT CONTROLLER and mapping it to the CONTEXT of all the views. Follow the below steps.
    1. Define a CONTEXT NODE in component controller
    2. Define same CONTEXT NODE in all the views where this has to be accessed & changed.
    3. Go to CONTEXT NODE of each view, right click on the node and choose DEFINE MAPPING.
    This is how you map CONTEXT NODE and same can be accessed/changed from any VIEW or even from COMPONENT CONTROLLER. Any change happens at one VIEW will be automatically available in others.
    Check the below link for more info regarding same.
    [http://help.sap.com/saphelp_nw04s/helpdata/EN/48/444941db42f423e10000000a155106/content.htm]
    Regards,
    Manne.

  • I have an Imac in my bedroom and apple tv hooked to my big screen in my living room. When I select mirror Imac on the Imac to view on the big screen in living room, can I get a wireless keyboard and track pad to control Imac from living room?

    I have an Imac in my bedroom and apple tv hooked to my big screen in my living room. When I select mirror Imac on the Imac to view on the big screen in living room, can I get a wireless keyboard and track pad to control Imac from living room?

    I do something like that, and can confirm 20 feet won't be a problem. More than 30 or so might be.

  • How can I select multiple files in the Import grid view in LR4?

    So far the only way I have discovered is to laboriously click the checkbox on each image I want to import. It seems that one should be able to select a range with one click (e.g. holding down Shift and then clicking the last image in the range) or by using a context (right-click) menu. No dice. What gives?

    I think two differeng groups of developers on two different planets designed the Library vs the Import views -- they sure are different!!
    I can answer your question because I had the same question and spent weeks clicking each individually.
    First ignore the checkboxes.  Then use click, ctrl+click, shift+click to select the thumbnails (NOT the Checkboxes, which is why I said to forget them for now!!)
    When you have selected what you want, find one of the selected photos and click its checkbox one way or the other, each click selects or deslects all the "selected" photos.

  • Can anyone tell me if you can select to view your podcasts in  TILE VIEW like before. thanks

    can anyone tell me if you can select to view your podcasts in  TILE VIEW like before. thanks

    I am having the same problems.  Firstly found out that I had a duplicate email address on two apple ids so I fixed that but now it wont let me verify the email address.  When I click on "verify email address" nothing happens.  So frustrating cos cant set up Facetime or iMessage on my iPad.

  • Create a view using a select statement

    Hi
    I need to create a view using a select statement to view details from 2 different tables which will only show data where the holidays commence after june.
    I am new to oracle so any help will do.
    Thanks

    Hi
    I need to create a view using a select statement to view details from 2 different tables which will only show data where the holidays commence after june.
    I am new to oracle so any help will do.
    Thanks

  • ORA-01445: cannot select ROWID from, or sample, a join view without a key-p

    Hi All,
    I am facing issue with one sql query. It is giving me error:
    ORA-01445: cannot select ROWID from, or sample, a join view without a key-preserved table
    I am not getting any clue to solve this. On internet, i didn't find proper reason for this error and troubleshooting way and solution for this error. Everywhere i saw one sentence, "Key preserved means the row from the base table will appear AT MOST ONCE in the output view on that table" but it didn't solve my problem.
    I have 1099 columns in one select query. so avoiding the actual column list in select clause. Instead I am trying to select ROWIDs from all tables in join. My understanding is ROWID is a unique identifier in table not in database. But though I remove ROWIDs, I get same error. So please don't bother about these ROWIDs.
    SELECT
    TO_DATE(FACT.BUS_DATE_FKID,'YYYYMMDD')
    ,FACT.ROWID AS ABC1
    ,FACT_ADJ.ROWID AS ABC2
    ,DIM_SEC.ROWID AS ABC3
    ,DIM_SEC_ADJ.ROWID AS ABC4
    ,DIS_CAT.ROWID AS ABC5
    ,CTRY.ROWID AS ABC6
    ,BCP.ROWID AS ABC7
    ,STAGE.ROWID AS ABC8
    FROM FACT_POSITION FACT
    LEFT JOIN FACT_POSITION_ADJ FACT_ADJ ON FACT.POSITION_PKID = FACT_ADJ.POSITION_FKID
    LEFT JOIN DIM_SOURCE_SYSTEM SOURCE ON FACT.SOURCE_SYSTEM_FKID = SOURCE.SOURCE_SYSTEM_PKID
    LEFT JOIN DIM_SECURITY DIM_SEC ON FACT.SUBSYS_SECURITY_FKID = DIM_SEC.SECURITY_PKID
    LEFT JOIN DIM_SECURITY_ADJ DIM_SEC_ADJ ON FACT.SUBSYS_SECURITY_FKID = DIM_SEC_ADJ.SECURITY_PKID
    LEFT JOIN DIM_DISCLOSURE_CATEGORY DIS_CAT ON FACT.DISCLOSURE_CATEGORY_FKID = DIS_CAT.DISCLOSURE_CATEGORY_PKID
    LEFT JOIN COUNTRY_REFERENCE CTRY ON CTRY.DESCRIPTION = DIM_SEC.ISSUER_COUNTRY
    LEFT JOIN BUSINESS_CLOSE_PERIOD BCP
    ON BCP.BUSINESS_CLOSE_DATE = ADD_MONTHS(TRUNC(TO_DATE(FACT.BUS_DATE_FKID,'YYYYMMDD'),'MM'), 1) -1
    AND BCP.IS_LOCKED='Y' AND BCP.IS_ACTIVE='Y'
    LEFT JOIN GUI_STAGING STAGE ON
    FACT.POSITION_PKID=STAGE.POSITION_PKID
    AND STAGE.IS_ACTIVE='Y'
    AND STAGE.STATUS_ID IN(12,8,1,2,3,4,5)
    WHERE FACT.POSITION_PKID=64524374;
    While trying to sort this error, I found interesting things that made me more confused.
    if I remove TO_DATE function from select clause, same join query works.
    If I remove any table from join and keep TO_DATE function in select clause, query works.
    That tells, there is no problem in query.
    Then please anyone help me to sort out the error. FYI. I have googled a lot for this error. but didn't get solution/clue. That is why I am posting this problem to forum.
    Thanks in advance. waiting for reply ASAP.
    Pravin Pujari
    [email protected]

    I think i got the solution. The syntax i was using (ANSI syntax) doesn't work in the oracle database version i am using.
    When i updated my query with older oracle syntax, it worked.
    SELECT
    TO_DATE(FACT.BUS_DATE_FKID,'YYYYMMDD')
    ,FACT.ROWID AS ABC1
    ,FACT_ADJ.ROWID AS ABC2
    ,SOURCE.ROWID AS ABC3
    ,DIM_SEC.ROWID AS ABC4
    ,DIM_SEC_ADJ.ROWID AS ABC5
    ,DIS_CAT.ROWID AS ABC6
    ,CTRY.ROWID AS ABC7
    ,BCP.ROWID AS ABC8
    ,STAGE.ROWID AS ABC8
    FROM [email protected] FACT
    ,[email protected] FACT_ADJ
    ,[email protected] SOURCE
    ,[email protected] DIM_SEC
    , [email protected] DIM_SEC_ADJ
    , [email protected] DIS_CAT
    , GUI.COUNTRY_REFERENCE CTRY
    , GUI.BUSINESS_CLOSE_PERIOD BCP
    , GUI.GUI_STAGING STAGE
    WHERE FACT.POSITION_PKID=64517140
    AND FACT_ADJ.POSITION_FKID(+) = FACT.POSITION_PKID
    AND SOURCE.SOURCE_SYSTEM_PKID=FACT.SOURCE_SYSTEM_FKID
    AND DIM_SEC.SECURITY_PKID=FACT.SUBSYS_SECURITY_FKID
    AND DIM_SEC_ADJ.SECURITY_PKID(+)=DIM_SEC.SECURITY_PKID
    AND FACT.DISCLOSURE_CATEGORY_FKID = DIS_CAT.DISCLOSURE_CATEGORY_PKID
    AND CTRY.DESCRIPTION = DIM_SEC.ISSUER_COUNTRY
    AND BCP.BUSINESS_CLOSE_DATE = ADD_MONTHS(TRUNC(TO_DATE(FACT.BUS_DATE_FKID,'YYYYMMDD'),'MM'), 1) -1
    AND BCP.IS_ACTIVE='Y'
    AND FACT.POSITION_PKID=STAGE.POSITION_PKID
    AND STAGE.IS_ACTIVE='Y'
    AND STAGE.STATUS_ID IN(12,8,1,2,3,4,5);

  • Retrieve value form Table view when the selection mode is 'NONE'

    Hi,
    I am new to ABAP, Can anyone tell me how to reterieve the records of the tableview, i have the selection mode as 'NONE'. When the button is clicked i need to reterieve all the values from the table and display it in the next screen.
    I am able to diaplay the table values , but i am unable to reterieve the values on Inputprocessing.
    Its very urgent. Please help me
    Regards,
    Jose

    you are able display the table view means, you have the data in internal table.
    you need all the records that are displayed in the table view with out selection. why dont you use that internal table itself, which is displayed as table view.
    vijay

  • Single click to show selected file in editor when in "edit view"?

    Anyone know if there is an option to set single click to show selected file in editor when in "edit view"?  Instead of having to double click?

    I would also like to be able to "right-click > edit source file" in multi-track view WHEN A CLIP IS GROUPED.
    Currently, when a clip is grouped with another clip, if you select a portion of that clip to edit, then right-click it, IT WILL NOT ALLOW YOU TO "EDIT SOURCE FILE" until you have ungrouped then re-selected it, which is cumbersome.
    Not only do you have to do that, but upon returning to MT VIEW you have to remember to re-group that clip with the other clips, not being able to right-click and edit the source file of grouped clips adds unnecassary trouble and confusion to the interface, and for what?

  • Is select from view faster then select from table..???

    Hello Gurus,
    I want to query some data from two tables, both of table have many columns (attributes) and many rows...
    I use several where clauses to retrieve data from those tables..
    witch one is faster, I create a view or I just "select" from those tables???
    Regards.
    Nia...

    riedelme wrote:
    3360 wrote:
    riedelme wrote:
    Selecting through a view almost never helps performance and frequently hurts.Views do not affect performance.
    Views are simply queries and like queries there are fast and slow ones.I disagree.
    First of all, to use a view you are executing a query to get a result set, then accessing the data from that result set - a built-in extra step to perform to get data.First of all that entire explanation of how views work is not correct. The optimizer will rewrite the query to make the view go away if possible.
    SQL> create or replace view v as select * from dual;
    View created.
    SQL> explain plan for select * from dual where dummy = 'X';
    Explained.
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 272002086
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |      |     1 |     2 |     2   (0)| 00:00:01 |
    |*  1 |  TABLE ACCESS FULL| DUAL |     1 |     2 |     2   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - filter("DUMMY"='X')
    13 rows selected.
    SQL> explain plan for select * from v where dummy = 'X';
    Explained.
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 272002086
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |      |     1 |     2 |     2   (0)| 00:00:01 |
    |*  1 |  TABLE ACCESS FULL| DUAL |     1 |     2 |     2   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - filter("DUMMY"='X')
    13 rows selected.Exactly the same.
    >
    Second, when accessing the data from the view the result sets don't have indexes for fast lookups and efficient joins on later steps.This is also known as just making stuff up and is not how the database works. care to share any references at all for any of this?
    >
    Third, the systems I've seen that use views extensively - I am looking at one now - tend to perform joins on views using the same tables with the same data over and over. This is a design issue and not specifically a problem with views but they lend themselves to this misuse much too easilyCorrect as I said a view is just a query, and just like queries there are good fast views and bad slow views
    >
    I'll concede that the problem is not specifically with views themselves but as I just said they lend themselves to misuse. Tuning views of views and views joined to views is difficultYes, queries can be misused as can almost all SQL functions and functionality.
    As I said - Views are simply queries and like queries there are fast and slow ones.
    Nothing that you have posted that is accurate changes that.

  • Auto select u201CView selection only on requestu201D in selection view screen-MM02

    HI Friends,
    I want to auto set u201CView selection only on requestu201D in selection view screen before entering into various views (Basic data 1 / Basic data 2 . . .etc) for t.code- MM02 for all users. Please let me know where needs to be set.
    Thanks in advance.
    RAMAN.

    Hi
    Please go to SM30 and enter the table USRM1. There you can control the user departments for the users and check the required filed " View selection on request" field name : -ASCHL.
    Hope this helps your requirement.
    Regards,
    Sunil.K

  • ListViewWebPart has limited to 50 views item in Selected View drop-down property

    Hello, we are currently in a context where we have over 70 view in one document library. When we add this document library into a custom webpart page, and choose "Modify Share Web Part". the "Selected View" drop down only contain the first 47 view + 4 default view. We are unable to chose  view #48 to 70.
    Does it exist any config to show more then 47 view in the "Selected View" drop down property of a "ListViewWebPart".
    N.B.: We know 70 view is a lot, but we are in a context where we needs those 70 views and they are named a easy way so the end-user can easily choose from them.
    Thanks!

    Also having the same problem.
    The views in the dropdown are sorted alphabetically so the first 50 are selectable.
    A workaround:
    - create a new view called aaa which is an exact copy of the view you want to display in the LVWP
    - now select the aaa view in the LVWP to display
    Regards, J.

  • HT2128 I am on Mac Lion. I about 36 photos frodownloadedm a friends storage place online.? I usually select about 10 at a time and view in preview (default) to make my selections. But Lion is saying blahblah.jpg is an application downloaded from the inter

    I am on Mac Lion. I downloaded about 36 photos from a friends storage place online.?
    I usually select about 10 at a time and view in preview (default) to make my selections. But Lion is saying "blahblah.jpg is an application downloaded from the internet.  Are you sure you want to open it?" These are files not applications (jpg's)
    Is there no way to change this and not get the question every time? I will have to do it for every picture one at a time- what a pain. The older operating system did not do this.

    It's possible, but not recommended unless you're an advanced user who understands the risk. Install the free application "TinkerTool" (not "TinkerTool System"), select the Applications tab, and check the box labeled "Don't show quarantine warnings for downloaded files." Log out and log back in. This action will disable the built-in protection against malware. You've been warned.

Maybe you are looking for

  • Generat additional records in the startroutine of a transformation

    Dear "Gurus", I have the following chalange: the records arriving into the transformation are structured like this 20080515 ; 20080721 ; 300'000.-    -> from  date ;    to date ;   total amount but what I need is a record for each single day with the

  • Connecting laptop to HP Officejet 8500

    Hello, I am trying to connect to the HP Officejet Pro 8500 a909a series through my laptop.  I found it on my laptop and it says connected but something else is trying to print, removed and tried again with no luck, is there a wireless switch or is it

  • Can I use a USB3 device on a IMAC27 from medio2010

    can I use a USB3 device on a IMAC27 from medio2010

  • Reinstall from creative cloud

    how do i reinstall from creative cloud? photoshop says that i have missing components aand need to reintall.  There is no install file under apps.  So I uninstalled and creative cloud does not recognise that so it will not let me install.

  • Sales Order Delivery Priority is not CIFed from ECC to APO

    I Have CIFed all master and transactional data like characteristics, products, Resources, PDS, Sales Orders, Stocks, Production and Planned Orders without any issue appart from the following: Delivery Priority of Sales Order: for all the Sales orders