Small design on the points of view and a Where Clause Board...

Hi all...  I just want to check Im doing things right, and he is not a better way to do this...

Running APEX 4.2.5 and XE 11.2

Ive built my application around a community of users who have access to certain groups of data...  Ive designed so that there are views and then transparent filter the data of a given user. for example, the view below seamlessly that users can see the filters depending on which application they use, they can see more specifically, what are the features and finally, what group they are actually in.

Create view ENTITIES like)

Select * from t_entities t

where exists (select 1

of application_groups ag

where ag.object_name = 'ENTITIES '.

and ag.object_id = t.entity_id

and ag.group_name = 'CASH FLOW')

and exists (select 1 from entity_users EU

where eu.username = nvl (v ('APP_USER'), USER) / * APEX APPLICATION USER * /.

and eu.entity_id = t.entity_id)

and it exists (select 1 from entity_group_members for example

where eg.entity_group = v('G_ENTITY_GRP_ID') / * ENTITY_GROUP * /.

and eg.entity_id = t.entity_id)

)

The overall costs when I run the explain command is very low (23 or almost), so I think that its an effective way of filtering... However, out of 300 entities or greater, the vast majority of users (75%) can see 75% of data...  Also, I need to create another view to filter another set of data with 2000 records. one with the view in place, 95% of the staff will see 95% of the data and only 10% of the staff see the other 10%...

I note that its faster when a member of a group brings back only a tiny part of the data compared to the other way around... This is why Im asking before implementing another view of the same type.

So, on my question. Is there a better way to do this, or the query should be on there head with a WHERE clause does NOT EXIST (xxxxx! = yyyyy)) or soemthing else ther is quite that Ive missed...

The only other comment is that Im using the upper table "APPLICATION_GROUPS" for more than one type of object (i.e. entities and entity accounts banking..) y at - it no merit in separaitng the two into two tables?

Thank you very much

Richard

Hi Richard,

Miss me a lot of information but:

I think that your design could be allowed. It seems a little too mat, maybe, but I think this could work.

It is important to have the good indexing and use compression of index:

On application_groups (object_name, the GroupName, groupname) compresses

IT compresses to entity_users (username, entity_id)

On the entity_group_members (entity_group, entity_id) compress

I think v as v ('G_ENTITY_GRP_ID') is a user-defined function? If so, if possible, set the deterministic and uses result_cache.

Consider partitioning application_groups type (= object_name?)

Tags: Database

Similar Questions

  • What happened to the point of VIEW when I use the CROP tool?

    What happened to the point of VIEW when I use the CROP tool?

    Hold the crop tool in the toolbar - you will find culture seen as a tool of void

  • Wallpaper from the point of view does not work on the iPhone 6

    Hello, I tried to set a wallpaper wallpapers apple and camera and my point of view option is disabled. And tried the hard reset and software update.

    Make sure that the settings > General > accessibility > reduce Motion is set to Off.

  • Dream Weaver cc Design view problems why is completely different design of the live display view

    Why Why oh why oh why is the cc Design view completely different from live view - live mode view is good, but virtually nothing is editable. How the hell can Adobe market a web as wysiwyg design tool when design mode is terrible. I saw old messages regarding this versions in 2014 and 2015.

    I'm not completely illiterate code but I would change the drawings etc. without digging deeper into the code. It's 2016 I stopped using the ages of tables there are available to my creations, but it seems that all cram into a table is the only way to get a half-decent idea of what is happening in design mode. I use a Mac which probably didn't help, but in the interest of the essential may be easier not more difficult.

    If it is true that Dreamweaver is really only for kernel developers hard, they should say so and start promoting Muse or similar for people who don't want to spend hours crafting code in all the different possible options such java php etc to produce a well-designed functional Web site.

    Does anyone know if there is a solution to this

    Design view has always been horrible to show you the design of the site, but some things worse.

    It does not run scripts of any type and more advanced css is completely invisible to the it. Code errors will also break Design mode almost instantly. Make sure you're validating your code under file > validate > validate the current document (W3C) or going directly to the validator online at http://validateo.w3.org/nu. Pay close attention to any structural errors listed are those that make the Design view go nuts.

    For what it's worth, DW is not really a wysiwyg program in the strictest sense of the acronym, regardless of how many guys at Adobe marketing wanted to believe this claim. DW requires a solid knowledge of html, css and javascript to get the best out there for static sites. These days, we use floats CSS, margin, padding and display properties to build our page layouts. While the program comes with base layouts, you can click to start with, do not understand the desire of "why it works" quickly cause massive frustration levels.

    If you really don't want you your hands dirty with the code, or simply do not have the time to become familiar with the basics of html and css, Adobe Muse would probably be a better option for you.

    Here are some links that will help you to understand its relationship to format html and css, and I hope that allow you to make more sense to DW:

    http://www.w3schools.com/HTML
    http://www.w3schools.com/CSS

  • What is the point of accuracy and scale to Type Number?

    Version: 11.2

    What is the point of having the precision and the SCALE type number? If you create the column with just NUMBER ie.without
    specify the precision or scale, you can enter numbers with a precision and scale.


    SQL> select * From v$version where rownum < 2;
    
    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    
    
    SQL> create table t1 (col1 number);
    
    Table created.
    
    SQL> insert into t1 values (223.9939394);
    
    1 row created.
    
    SQL> insert into t1 values (88.228384);
    
    1 row created.
    
    SQL> insert into t1 values (9.34);
    
    1 row created.
    
    SQL> insert into t1 values (000.00);
    
    1 row created.
    
    SQL> commit;
    
    Commit complete.
    
    SQL> select * from t1;
    
          COL1
    ----------
    223.993939
     88.228384
          9.34
             0
    Do you already have a scenario where a numeric column should store only values with a fixed precision and scale?

    Omega-3 wrote:
    Version: 11.2

    What is the point of having the precision and the SCALE type number? If you create the column with just NUMBER ie.without
    specify the precision or scale, you can enter numbers with a precision and scale.

    SQL> select * From v$version where rownum < 2;
    
    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    
    SQL> create table t1 (col1 number);
    
    Table created.
    
    SQL> insert into t1 values (223.9939394);
    
    1 row created.
    
    SQL> insert into t1 values (88.228384);
    
    1 row created.
    
    SQL> insert into t1 values (9.34);
    
    1 row created.
    
    SQL> insert into t1 values (000.00);
    
    1 row created.
    
    SQL> commit;
    
    Commit complete.
    
    SQL> select * from t1;
    
    COL1
    ----------
    223.993939
    88.228384
    9.34
    0
    

    Do you already have a scenario where a numeric column should store only values with a fixed precision and scale?

    Plenty of needs of the company for specific details and scales.

    An age can the persons required to be stored as whole not more 3-digit numbers.
    A sum of money may have to be stored with no more than 2 decimal places of accuracy for example the books of GB Pence or US Dollars and Cents
    A unit of length may need to be stored in meters with 2 decimals of centimetres
    A size may have to be stored with a decimal for half sizes
    etc.
    etc.

    Yes, you can create simply as a generic NUMBER data type, but their design with precision and scale can provide additional information on the limitations for the stored values, especially for things like tools that can use the specified precision and scale to determine how to display the automatically (default) values of reporting.

    If you start to question "what is the point?" then you may as well say what's the point of having a NUMBER data type when we can store numbers in a VARCHAR2 data type? or what's the point of having a DATE data type, when we can stored dates as VARCHAR2 data type? etc.

    No need to ask such a question because there is almost always a point to these things (and if not what they get deprecated in future versions).

  • The my folder view and all Emails are invisible on the backup PC

    I use Thunderbird for several years and a year and a half ago moved my TB *.default folder to a folder in Dropbox so that my email would synchronize no matter if I used my "daily driver" iMac, or backup PC running XP. Of course I properly edited the path to the new folder *.default"in the file profile.ini for each machine. It really worked slick, as it should.

    Although the PC gets started on every two weeks on average, I have to use Thunderbird on this, since I have upheld that it functioned normally by above - until now. I'm having a problem of material with my iMac, so I launched Thunderbird on the PC, and the folders pane, although there is now totally empty. The message pane shows no message, and when I click on 'Read Messages', nothing happens - does not change the view. Similarly, by selecting "Message pane - or overlay F8 - does nothing. There is no error pop up on launch. The folders pane is selected in the drop-down menu, and I've exhausted all options possible view and still can not all records (XP is completely up-to-date, end of support by way of derogation and I keep the antivirus updated PC and run on a regular basis.) Given that the PC is barely used, I very rarely found no problem with it.)

    When I open the error Console I see errors in the following lines: 784, 131, 250, 287, 2432, 287 and 300. I tried to copy and paste here, but it does not work (is there a way to save the error report in a text file?)

    It would be really nice to solve this problem so that I can use Thunderbird on my PC until I can get my iMac fixed. Any help will be greatly appreciated!

    I have just removed & re-installed TB, edited profiles.ini properly, and now everything is fine! Probably should have try this 1st (20/20 with hindsight and all that...)

  • Too small police in the area of text and some programs in vista

    I can't read the text in the box on the page internet IE and firefox as well as some programs in my computer. I have not found the solution for this problem on the internet, including using microsoft and response. Please don't suggest me IE uncheck options - move - visual blah blah or press on CTR and scrolling up, none of them are working. I think the problem in windows vista, but I can't find, wht caused.

    Hello

    I solved the problem which the police is causing the problem, you must reinstall the fonts.

    Type fonts in the search box when the police all pop-up left click in the empty spot of the fonts page, you will see install it new font. After this action if bad things police to install probably its Times new Roman, or I prefer you install all. Your problem will disappear that text in the text box will be not small.

  • Lightroom CC (2015) continually crashes when switching from the library view to the point of view

    After you select an image in the library view, LR2015 frequently stops working when the "Develop" tab is selected. LR identifier at the top of the window, says "not responding". By pressing the "Close" button generates a Windows message "Adobe Photoshop Lightroom is no answer". I am running Windows 7 64 bit, with all updates.

    Try to go to the preferences, tab performance and de-selection ' processor graphics user "Lightroom.

  • What happens after that reset the card (from the point of view JCRE)?

    Hello

    In the windows environment, to maintain the State of application, I cam imagine that data is serialized and saved in a text file. The second call of app, the data in the text file are reloaded to reconstruct objects and form the latest state of the application.

    In the middle of the map, suppose I have a few cmdlets on the map. Reset of the card, I think the boot trap method is invoked and reload the data for each applet to keep state.

    The point is, to load data, everything is done in native code, but objects to be re-inited run java layer. Is this feasible? Or JCRE will initialize the applets in java layer?

    Could you correct my understanding and share your knowledge on something else after reset of the card? Or after reset of the card, JCRE does nothing, objects inherit from its reference, the class structure of the map features?

    Thank you

    Mike

    They are delivered to the default value for this type (0 or false).

    See you soon,.
    Shane

  • Movement of two corners of an entrant rec rounded to give the point of view

    Hello

    I don't know there must be a better way to do what I do.

    I have a rounded rectangle and I want to spend the two upper corners inward toward each other at the same time (such as adding a time frame).

    I am currently using the free tool of distortion in the effects, but I don't know if I do them exactly the same distance from a move.

    Thank you!!!

    Babs

    1. create a rectangle
    2. Effects > Stylize > round corners
    3. Use the point to select Direct Selection tool and use the cursor (or move cursor for 10 x the distance) keys to push, so you can keep track of the exact distance

    In this way the curvature is the same on all 4 corners, and you can also set since it is applied as an effect

    If you don't want the identical curvature on each of the 4 corners, then create a rounded rectangle rather on stage #1 and ignore the step #2.

  • Best place to initialize the View object query where clause or params

    Where is the best place to initialize the View object 'where' clause before the page is initially rendered? Or how should it be done?
    Specifically, I can't set these values in the entity or view objects because I need information from the user or information Session
    the user has entered before you navigate to the page. I want to prepare the View object so that the results of the query appears something reasonable
    the first time before using chooses search.

    Note: The view object must exist and I need to access managed beans to define the query.

    Is there an event hook (java code) that can be called before the page is rendered?
    Also, there are hooks that can be called when the user navigates to another tab or page?

    Published by: Greateful Sep 6, 2012 19:48

    Hello

    Check out this blog: https://blogs.oracle.com/aramamoo/entry/an_epic_question_how_to

    Arun-

  • Group by, with and without where clause

    Do I need to use these two interior views to display the results by group by a line? I can get the same result without having to type the same statement select twice since these two SELECT statements differ only in where clause. This query is a simulation. My actual query is longer. My hope is to make this shorter query (without interior views).
    with tmp as (
    select 'COMPLETE' status, 'GERMANY' country, 0 substatus FROM dual UNION ALL
    select 'COMPLETE' status, 'GERMANY' country, 1 substatus FROM dual UNION ALL
    select 'COMPLETE' status, 'GERMANY' country, 0 substatus FROM dual)
    select v1.status, v1.country, v1.cnt01, v2.cntIncluding0 from 
    (select status, country, count(*) cnt01 from tmp tmp1 group by status, country) v1
    JOIN
    (select status, country, count(*) cntIncluding0 from tmp tmp2 where substatus=0 group by status, country) v2
    on v1.status=v2.status and v1.country=v2.country;
     

    totalnewby wrote:
    Do I need to use these two interior views to display the results by group by a line? I can get the same result without having to type the same statement select twice since these two SELECT statements differ only in where clause. This query is a simulation. My actual query is longer. My hope is to make this shorter query (without interior views).

    with tmp as (
    select 'COMPLETE' status, 'GERMANY' country, 0 substatus FROM dual UNION ALL
    select 'COMPLETE' status, 'GERMANY' country, 1 substatus FROM dual UNION ALL
    select 'COMPLETE' status, 'GERMANY' country, 0 substatus FROM dual)
    select v1.status, v1.country, v1.cnt01, v2.cntIncluding0 from
    (select status, country, count(*) cnt01 from tmp tmp1 group by status, country) v1
    JOIN
    (select status, country, count(*) cntIncluding0 from tmp tmp2 where substatus=0 group by status, country) v2
    on v1.status=v2.status and v1.country=v2.country;
    
    SQL> with tmp as
      2  (
      3  select 'COMPLETE' status, 'GERMANY' country, 0 substatus FROM dual UNION ALL
      4  select 'COMPLETE' status, 'GERMANY' country, 1 substatus FROM dual UNION ALL
      5  select 'COMPLETE' status, 'GERMANY' country, 0 substatus FROM dual
      6  )
      7  select status,
      8         country,
      9         count(substatus) cnt01,
     10         sum(decode(substatus, 0, 1, 0)) cntincluding0
     11    from tmp
     12   group by status, country
     13  ;
    
    STATUS   COUNTRY      CNT01 CNTINCLUDING0
    -------- ------- ---------- -------------
    COMPLETE GERMANY          3             2
    
  • Order columns (which make up the primary key constraint) matter in where clause of DML query for use of indexing mechanism to operate.

    Version of DB: database Oracle 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production


    I have a table my_table as below:
    create table my_table
    (
    my_code varchar2 (6).
    my_id varchar2 (24).
    forced pk_1 primary key (my_code, my_id)
    );


    Primary_key here's a composite key that contains columns 1 (my_code) and 2 (my_id).
    Is there that a difference in the way below queries is executed in terms of performance (use of indexing in the extraction).

    (a) select * from my_table where my_code = '123' and my_id = "456";
    (b) select * from my_table where my_id = '456' and my_code = '123';


    The understanding I have the order of the column in the where clause should be identical to the sequence in
    What primary key draws for indexing to be used by oracle in oracle other DML queries ignores indexing
    However when I used explain plain both show the same query cost with single scan with index rowid.
    so I don't know if I'm wrong in the concept that I have. Kindly help.

    Thanks in advance,
    Gerard

    Your question is answered in the Performance Tuning Guide

    Using indexes and clusters

    14.1.4 choosing composite indexes

    A composite index contains several key columns. Composite indexes can provide additional benefits compared to the index to single column:

    • Improved selectivity

      Sometimes the two or more columns or expressions, each with a low selectivity can be combined to form a composite with a high selectivity.

    • Reduced IO

      If all columns selected by a query are a composite index, then Oracle may return these values in the index without access to the table.

    A SQL statement can use a path on a composite index if the statement contains constructions that use a main part of the index.

    Note:

    This is no longer the case with the skip index scans. See "Index Skip Scans".

    A main part of an index is a set of one or more columns that have been specified first and consecutively in the list of columns in the CREATE INDEX statement that created the index.

  • Calculate the sum of values of 2 where Clauses

    Hi, sorry to trouble, I have all the data in a database or anything like that, just to think about some of the work I have to do, trying to get ahead. I was wondering how i would be the sum of the values in a column, but with 2 where clauses. By example, if I wanted to the sum of all the values until 18:00 in 1 column and all the after 18:00 for 1 day how I would write this out.

    I don't know how to write separately, i.e.

    select name, sum(values) as after6
    from table
    where time > '18:00'
    group by name;
    

    select name, sum(values) as upto6
    from table
    where time < '18:00'
    group by name;
    

    How can I combine these columns after6 and upto6 next to each other.

    If someone could please advise.

    Thanks in advance

    Select the name,

    sum (case when time > 18:00 ' then 0 otherwise end of values) as after6,.

    sum (case when time< '18:00'="" then="" values="" else="" 0="" end)="" as="">

    table

    Group by name;

    ----

    Ramin Hashimzade

  • Difference-conditions (join and a Where Clause)

    Hi people,

    I need to clearly agree on what a difference exactly when we put any condition in INNER JOIN and the WHERE Clause.

    I have tried both way and found the same results. Even in the statistics Plan not much differences.  Any help would be appreciated.

    As:

    1 here, I use filter store in the join condition - Inner

    "SELECT i., Gl * Sc1.Item I.

    Inner Join Sc1.Part P

    On P.Part_Id = I.Part_Id

    Inner Join Sc1.Location Gl

    On Gl.Location_Id = I.Location_Id

    And Gl.Location_Id in (1767, 1747,202,1625)

    Inner Join Sc1.Condition C

    On C.Condtion_Id = Gl.Condition_Id

    Where I.Inactive_Ind = 0

    And I.Condition_Id! = 325

    2. here I use filter store in Where clause-

    SELECT i., Gl * Sc1.Item I

    Inner Join Sc1.Part P

    On P.Part_Id = I.Part_Id

    Inner Join Sc1.Location Gl

    On Gl.Location_Id = I.Location_Id

    Inner Join Sc1.Condition C

    On C.Condtion_Id = Gl.Condition_Id

    Where I.Inactive_Ind = 0

    and I.LOCATION_ID in (1767, 1747,202,1625)

    And I.Condition_Id! = 325

    Thank you

    Mark



    Hello

    MarkCooper wrote:

    Hi guys,.

    To reply to all - I understand.

    1. its good practice to use conditions / filter (except CLAUSE) in the WHERE Clause rather Inner join? bon ?

    2. now, in my previous example. We could use the location code in where clause as it was in the two tables.

    What is the best practice to use the code to location here ( 1 /2) ?

    1. here I use filter store in the Inner join condition ( guess the location code is not in the article table)).

    "SELECT i., Gl * Sc1.Item I.

    Inner Join Sc1.Part P

    On P.Part_Id = I.Part_Id

    Inner Join Sc1.Location Gl

    On Gl.Location_Id = I.Location_Id

      And Gl.Location_Id in (1767, 1747,202,1625)

    Inner Join Sc1.Condition C

    On C.Condtion_Id = Gl.Condition_Id

    Where I.Inactive_Ind = 0

    And I.Condition_Id! = 325

    2. here I use filter store in Where clause (assume that the location code is not in the article table)-

    SELECT i., Gl * Sc1.Item I

    Inner Join Sc1.Part P

    On P.Part_Id = I.Part_Id

    Inner Join Sc1.Location Gl

    On Gl.Location_Id = I.Location_Id

    Inner Join Sc1.Condition C

    On C.Condtion_Id = Gl.Condition_Id

    Where I.Inactive_Ind = 0

      And Gl.Location_Id in (1767, 1747,202,1625)

    And I.Condition_Id! = 325

    Thank you

    If location_id isn't in the item table, then the join condition

    On Gl.Location_Id = I.Location_Id

    will cause an error.

    Once more, it should not affect results or performance if a condition like

    Gl.Location_Id in (1767, 1747,202,1625)

    is in the clause or the WHERE clause.  No matter if it is be a column called location_id in any other table, or if the same column Gl.Location_Id is used in other conditions.

    As this condition only refers to a table (GI), I recommend you put it in a WHERE clause, just to make the code clearer.

    Yet once, this applies only to the inner joins, not for outer joins and not to CONNECT BY queries.

Maybe you are looking for