Table design one-to-one relation

For a big table such as this: PROJECT_TABLE which contains 75 columns. But, only 40 columns are frequently searched against, i.e., the user enter some criteria on a web page, then start the search. The rest 35 columns are used on as-needed basis, i.e., only if the user want to view a specific record (in the returned search result). I am afraid that as the records grow, someday, the search will slow down (due to the large number of columns in the table).
So, I plant to break the PROJECT_TABLE into two separate tables PROJECT_PARENT (project_id) and PROJECT_CHILD (project_id) and reference them by one-to-one relation. By this way, when the user conducts the search, it will be done against the PROJECT_PARENT table; while when user wants to view a specific record, it will then retrieve the data by using one-to-one join of the two tables.
Like to know if it really help by breaking into two tables. What is your comment?
Thanks
Scott

scottjhn wrote:
For a big table such as this: PROJECT_TABLE which contains 75 columns. But, only 40 columns are frequently searched against, i.e., the user enter some criteria on a we page, then start the search. The rest 35 columns are used on as-needed basis, i.e., only if the user want to view a specific record (in the returned search result). I am afraid that as the records grow, someday, the search will slow down (due to the large number of columns in the table).
So, I plant to break the PROJECT_TABLE into two separate tables PROJECT_PARENT (project_id) and PROJECT_CHILD (project_id) and reference them by one-to-one relation. By this way, when the user conducts the search, it will be done against the PROJECT_PARENT table; while when user wants to view a specific record, it will then retrieve the data by using one-to-one join of the two tables.
Like to know if it really help by breaking into two tables. What is your comment?if you proceed, performance will be worse than if you do nothing.
Do you suffer from Compulsive Tuning Disorder?
Are you bored & looking for some activity to keep you busy?

Similar Messages

  • Adding data to multiple tables using one form in Access 2010?

    Hi All,
    I have a access database with two tables and I want to create a single form to enter data into that tables.
    How to adding data to multiple tables using one form in Access 2010?
    I don't have to much knowledge of access database?
    Please help me
    Thanks
    Balaji

    You really don't enter identical data into 2 tables.  You enter dat into one single table, and then you have an unique identifier that maps to another table (you have a unique relationship between two tables). 
    Maybe you need to read this.
    http://office.microsoft.com/en-001/access-help/database-design-basics-HA001224247.aspx
    Think about it this way...  What is you update data in 2 tables, and then the data in one of those tables changes, but the data in the other table does NOT change.  WHOOPS!!  Now, you've got a BIG problem.  For instance, you have a customer
    named Bill Gates.  In one Table you update Bill's address to 1835 73rd Ave NE, Medina, WA 98039 and in the other table you accidentally update Bill's address to 183 73rd Ave NE, Medina, WA 98039.  Now you have 2 addresses for Bill.  Why would
    you want that???  Which is right?  No one knows.  If you have one address, you just have to update one address and if there is a mistake, you just have to update one address, but you don't have to waste time trying to figure out which is right
    and which is wong...and then update the one that is wrong.
    Post back with specific questions.
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

  • Mapping Issue with 7 source tables and one target table in one step

    Hi,
    Request for a small help in OWB.
    I am trying to map 7 source tables to a single target table in one step.These source tables are in Oracle 10G database but dont have PK and FK relation ship.
    I am able to link one table to the target by pointing some of the columns. But when coming to the second table it is giving some error message :
    Ap18003: Connection target attribute group is already connected to a incompatible data source. Use a joiner or set operator to join the upstream data first before connection it to this operator.
    As per the error message I used a Join operator and tried to map the second table to the target but still giving me the same error message. Could some body give me a hand to give out from this step.
    Thanks for your help in advance.
    Cheers,
    Krishna.

    Hi,
    like this:
    Ingroup1
    - id -> Number(9,0)
    - name -> VARCHAR2(500)
    Ingroup2
    - my_id -> Number(9,0)
    - name -> VARCHAR2(500)
    Outgroup
    - id -> point to target_table.id
    - name -> point to target_table.name
    Not:
    Ingroup1
    - id -> Number(9,0)
    - name -> VARCHAR2(500)
    Ingroup2
    - name -> VARCHAR2(500)
    - my_id -> VARCHAR2(9)
    Regards
    Detlef
    null

  • How to fill the data of two different tables into one?

    Hi Experts,
    I have two tables named CDHDR and CDSHW(structure). I have extracted the  data from these two tables through two function modules named CHANGEDDOCUMENT_HEADER and CHANGEDOCUMENT_POSITION. Now I have the data in to different tables.
    These two tables neither has relationship with each other through any field nor have any field which exist in both. Can anyone tell me in this case what should be the process to take the data of both the tables into one table. How can I match the record of one table to another?
    thanks a ton in advance.
    Edited by: Moni Bindal on Apr 28, 2008 4:16 PM
    Edited by: Alvaro Tejada Galindo on Apr 28, 2008 1:42 PM

    Hye Bindal,
      without a relation, it is not possible to club the data of 2 internal tables. More over it depends on the requirement as to y u should club to non related quantities in an internal table.
    if you wish to do so, one thing is it has internal table which includes the strucute of the 2.
    data: begin of ty_out,
              first type first_structure,
              second type second_structure,
             end of ty_out.
    data: itab type standard table of ty_out.
    data: wa type ty_out.
    loop into it1 into wa1.
    move corresponding wa to wa1.
    append wa to itab.
    endloop.
    loop into it2 into wa2.
    move corresponding wa to wa2.
    append wa to itab.
    endloop.
    now the internal table itab will have all the contents of it1 and it2.
    <REMOVED BY MODERATOR>
    Thanks,
    Imran.
    Edited by: Alvaro Tejada Galindo on Apr 28, 2008 1:43 PM

  • Importing CSV files into Multiple Tables in One Database

     I have a web based solution using Microsoft SharePoint and SQL Server that is created to centralize dat collection and reporting of program metrics used in montly reviews.
    A person from each program enters dat manual or by pushing the data using automated data import tools. The user then is able to generate reports and provide presentations to their stakeholders.
    There are are programs that are located in US and 2 that are located in Japan. All, including programs in Japan use the MS Project with a plug-in tool that allows them to auto input data. When the user click the "Send To.." button, the data goes
    in to multiple tables in one database.
    Everything is set up exactly the same for every program; however, we have discovered becase of a firewall, along with some of the different settings that the MS Project has over in Japan, the 2 program users are not able to auto import their data.
    The suggestion is to have the program users export the MS Project file into a CSV and email it. I will then take it and convert the data, such as the dates and place them on a Network Drive. There will be 2 folders, one for each program.
    I feel it will be an easy process just to load the data from the Network Drive into the same tables that are created for auto import.
    My Concerns/Questions:
    1. Should I create 1 SSIS package or should there be 2, one for each program?
    2. US and Japan program users send their data once a month. The converted files are going to be saved in the location marked with a date (ex:201402). How can i have it to where SSIS will automatically load the data every time i place new files in the designated
    folders or when i update an exsisting file?
    Can you provide an example with your suggestion please?
    I greatly appreciate the assistance!
    Y_Tyler

    Hello Vikash,
    Thank you! This will help me get started.
    There will be 2 folders, one with files with Program A data and the other with files with Program B data. All will have the same fields, just coming from different programs. You stated that I will be able to to load both in one package. Would there be two
    paths since there will be two separate folders?
    Using the example you provided, i am confident that I can create the package using one path into one table but not sure how to get the files from 2 paths (if there is) into multiple tables.
    Can you help clarify this for me?
    Thank you!
    Y_Tyler

  • Export multiple tables into one flat file

    I have data in multiple tables on a processing database that I need to move up to a production database. I want to export the data into a flat file, ftp it to the production server and have another job pick up the file and process it. I am looking for
    design suggestions on how to get multiple tables into one flat file using SSIS?
    Thank You.

    Hey,
    Without a bit more detail, as per Russels response, its difficult to give an exact recommendation.
    Essentially, you would first add a data flow task to your control flow.  Create a source per table, then direct the output of each into an union all task.  The output from the union all task would then be directed to a flat file destination.
    Within the union all task you can map the various input columns into the appropriate outputs.
    If the sources are different, it would probably be easiest to add a derived column task in-between the source and the union all, adding columns as appropriate and setting a default value that can be easily identified later (again depending on your requirements).
    Hope that helps,
    Jamie

  • 10g express, scheduled copy of table from one db to another

    Hi,
    I don't know much about Oracle and was hoping if someone could shed some light on how we could implement our solution.
    Our scenario is as follows:
    For a new customer we are going to have 35million records per month coming into the database.
    What we had normally been doing in MSSQL, is creating a new table every month and writing the records in here (although we never had 35 million records before).
    The problem is, I want to archive these old monthly tables in order to save space. I don't know enough about the Oracle suite to see if there is already a program that we can schedule every month to move this table from one database to another. I was initially doing it by code, but this ends up taking 3 hours to copy... something we cannot afford.
    Is 35 million records too much to hold in a table? Should we be partitioning this down even more? I don't know where the threshold is before Oracle craps out.
    Or, maybe a better idea is to create a new database and just store new entries in a new database every month... this way we won't need to copy anything. To me, this sounds stupid though as i don't want to have 60 databases kicking around in five years.
    I'm a developer and no DBA, no one here is a DBA. We're trying to evaluate if our application is going to work on a Oracle platform all without knowing anything about it. Please help!
    Thanks,
    Kevin
    Message was edited by:
    user518940

    Kevin, you definately have the right database for 35M records/mth.
    From your post, it sounds like you need to retain the records in a database for 5 years (yes?). I don't know of any size limitation for Oracle outside of the OS. I don't think your solution should be multiple databases unless you have vastly different needs for the database that can not be satisfied with one instance - ie. OLTP vs. BATCH/OLAP...
    I don't fully understand what you are shooting for because it doesn't sound like you are going to save on any space just by moving the data from one database to another, the records will still require a similar amount of space unless compressed on another database. In either case, unless you can't, I would recommend a single database design. If you need high performance querying the data, and you query it by a specified period of time - ie month, I would recommend using enterprise edition with partitioning (seperately licensed). This would allow you to create a partitioned table where you could partition the table by month. As long as you don't create unnecessary global indexes, the performance should be quite similar to querying/inserting/appending into a table just containing 1 months records. Each partition can be placed in its own tablespace/datafile(s).
    If you absolutely must 'transport' the data to another instance (which I would strongly suggest that you should load it there in the first place unless business rules, performance limitations or something else simply don't allow it), you can use 'transportable tablespaces' and simply ftp the entire datafile to another Oracle database and attach it thus avoiding having to reload it. If it's truly historical you can just leave it ReadOnly. If you want to be tricky about it, you could try to make it part of a partitoned table on the new host.
    I hope I've helped just a little bit. If you need additional help, email me directly at LenLopez AT Yahoo DOT com

  • Get One to One relation information from SMO

    Hello I have 2 tables.
    Business & categories. Both are connected using one to one relation.
    In business table I created ForeignKey relation to Category & then I made CategoryId column of Business Table Unique Key in index.
    In this way I create One to one relation between them.
    So from Business I can get Category by using Following SMO Code:
    foreach (Microsoft.SqlServer.Management.Smo.Table table in lstTableName)
    var ReferenceData=table.ForeignKeys;
    It is fine. But Now from category Table I also want to see Business Object. I know that I can travers EnumForeignKeys() But in that I can get its SetCollection data.
    But I want o know the information regarding One to One relationship . that meance I want to see cardinality information from SMO.
    Is there any way that I can have that information using SMO?
    If ismo is not possible then some kind of SQL query is also ok for me.
    Thanking you in advance..
    Regards
    Vipul Langalia

    Hi,
    IMO this does not seem possible using SMO or any other method as well.
    You cannot create a 1..1 relationship directly in SQL Server.
    To implement such a relationship we need to create a FOREIGN KEY and then create a UNIQUE constraint on the foreign key column, this again does not guarantee 1..1 relationship but 0..1 relationship.
    So what you can do is check if UNIQUE constraint is defined on the foreign key column in the referencing table.
    - Vishal
    SqlAndMe.com

  • How to create one to one relation in database diagram

    Hi!
    I'd like to create a database diagram in JDeveloper 10g. Is there any possibility to create a one-to-one relation between two tables?
    Thanks in advance,
    Jim

    This seems to be the same problem that I am having. I was trying to create a database diagram with tables imported from the database. I have two tables having a 1 --> 0..1 relationship. However when I pulled these tables on to a database diagram , it displayed as a 1 --> * relationship. I also realized that JDeveloper does not allow you to change the cardinality in a database diagram.
    As a workaround, I created a class diagram and named the classes the same as the database tables. Then I used UML connectors to show the relationships with the correct cardinality. Since I did not need to show the column names on the diagram, it was sufficient for my purpose. I hope this bug is fixed soon, otherwise I will have to use some other tool to create database diagrams.

  • Query to achieve exclusively one-to-one relation data

    Hi,
    I am looking for a query to find rows with one-to-one relation ship.
    To make it simple here is the sample code.
    CREATE TABLE my_storegroup_gbcust
      store_grp_id        NUMBER(6)                 NOT NULL,
      group_buy_cust_num  NUMBER(5)                 NOT NULL
    INSERT INTO my_storegroup_gbcust (store_grp_id, group_buy_cust_num ) VALUES (1002, 70001);
    INSERT INTO my_storegroup_gbcust (store_grp_id, group_buy_cust_num ) VALUES (1003, 70001);
    INSERT INTO my_storegroup_gbcust (store_grp_id, group_buy_cust_num ) VALUES (1004, 70001);
    INSERT INTO my_storegroup_gbcust (store_grp_id, group_buy_cust_num ) VALUES (1005, 70001);
    INSERT INTO my_storegroup_gbcust (store_grp_id, group_buy_cust_num ) VALUES (1006, 70001);
    INSERT INTO my_storegroup_gbcust (store_grp_id, group_buy_cust_num ) VALUES (2001, 65000);
    INSERT INTO my_storegroup_gbcust (store_grp_id, group_buy_cust_num ) VALUES (28001, 21800);
    INSERT INTO my_storegroup_gbcust (store_grp_id, group_buy_cust_num ) VALUES (35001, 27010);
    INSERT INTO my_storegroup_gbcust (store_grp_id, group_buy_cust_num ) VALUES (35001, 37927);
    select * from MY_STOREGROUP_GBCUST
    STORE_GRP_ID     GROUP_BUY_CUST_NUM
    1002               70001
    1003               70001
    1004               70001
    1005               70001
    1006               70001
    2001               65000
    28001               21800
    35001               27010
    35001               37927The data in the table describes 3 types of relations.
    Many-to-One => Many store groups to one group buy => Example : 1002,1003,1004,1005,1006 mapped to 7001
    One-to-One => One store group to one group buy only => Example : 2001 mapped to 65000 ; 28001 mapped to 21800
    One-to-Many => One store group to many group buy => Example: 35001 mapped to 27010,37927
    Now I am able to achieve through query One-to-Many and Many-to-One by as below :
    select group_buy_cust_num,count(*) from MY_STOREGROUP_GBCUST group by group_buy_cust_num having count(*) > 1
    select store_grp_id,count(*) from MY_STOREGROUP_GBCUST group by store_grp_id having count(*) > 1    But how do I get One-to-One exclusively.
    Thanks,
    Raj.

    This is what I get by changing > to = sign.
    select group_buy_cust_num,count(*) from MY_STOREGROUP_GBCUST group by group_buy_cust_num having count(*) = 1
    GROUP_BUY_CUST_NUM     COUNT(*)
    21800               1
    27010               1
    65000               1
    37927               1
    select store_grp_id,count(*) from MY_STOREGROUP_GBCUST group by store_grp_id having count(*) = 1
    STORE_GRP_ID     COUNT(*)
    28001               1
    1005               1
    2001               1
    1003               1
    1002               1
    1004               1
    1006               1But I need just this
    STORE_GRP_ID     COUNT(*)
    2001               1
    28001               1

  • One on one relation

    Dear all,
    I have a master block in table form that displays 20 rows.
    Is it possible to have a detail block (one on one relation), also displaying 20 rows (on the right side of the master block.
    Example:
    Masterfield1 Masterfield2 Masterfield3 Detailfield1
    Masterfield1 Masterfield2 Masterfield3 Detailfield1
    Masterfield1 Masterfield2 Masterfield3 Detailfield1
    Masterfield1 Masterfield2 Masterfield3 Detailfield1
    Masterfield1 Masterfield2 Masterfield3 Detailfield1
    Masterfield1 Masterfield2 Masterfield3 Detailfield1
    When I try to do this, the detailfields I fill in are all connected to the first masterrecord.
    Is it possible to create a one-on-one relation?
    Thanks.

    That's not that big problem.
    - Set the fields of your ERP view to "query only"
    - Create a view with an outer join with the table and your erp view (with respect to performance create a view
    directly on the tables, not on your view)
    - use the primary key of the table as the primary key of the block
    - set the dml data target name of the block to that of your table
    - rewrite the on_insert and on_update and on_insert triggers like...
    on_insert:
    well, I think it's not allowed
    on_update:
    if primary key is null then
    insert ...
    (check that you got the primary key after inserting)
    else
    update ...
    end if;
    on_delete:
    I think you can use the original one.
    That should work.
    Regards,
    Torsten

  • How to move table from one tablespace to other tablespace?

    how to move table from one tablespace to other tablespace?

    887274 wrote:
    how to move table from one tablespace to other tablespace?
    alter table <table_name> move  tablespace <new_tablespace_name>;
    Rebuild the indexes; alter index <index_name> rebuild <new_tablespace_name> online;Example;:
    SQL> create table ttt( ID NUMBER PRimary key);
    Table created.
    SQL> insert into ttt values (1);
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select index_name, status  from dba_indexes where table_name='TTT';
    INDEX_NAME                 STATUS
    SYS_C0010863                 VALID
    SQL> alter table ttt move tablespace users;
    Table altered.
    SQL> select index_name, status  from dba_indexes where table_name='TTT';
    INDEX_NAME                 STATUS
    SYS_C0010863                 UNUSABLE
    SQL> alter index SYS_C0010863 rebuild tablespace users online;
    Index altered.
    SQL> select index_name, status  from dba_indexes where table_name='TTT';
    INDEX_NAME                 STATUS
    SYS_C0010863                 VALID
    SQL>

  • How can we copy table from one schema to other schema

    Hi,
    I have create one table in one schema and i want to copy it to other schema.How we can copy table from one schema to other schema

    Hi,
    You can try something like this :-
    SQL> CONNECT SYS/SYS123@SERVER AS SYSDBA
    Connected.
    SQL> CREATE USER TEST_1 IDENTIFIED BY TEST_1;
    User created.
    SQL> CREATE USER TEST_2 IDENTIFIED BY TEST_2;
    User created.
    SQL> GRANT CONNECT,RESOURCE,DBA TO TEST_1;
    Grant succeeded.
    SQL> GRANT CONNECT,RESOURCE,DBA TO TEST_2;
    Grant succeeded.
    SQL> CONNECT TEST_1/TEST_1@SERVER
    Connected.
    SQL> CREATE TABLE TEST_COPY ( TEST_COL NUMBER );
    Table created.
    SQL> INSERT INTO TEST_COPY VALUES ( 1 );
    1 row created.
    SQL> INSERT INTO TEST_COPY VALUES ( 2 );
    1 row created.
    SQL> COMMIT;
    Commit complete.
    SQL> GRANT ALL ON TEST_COPY TO TEST_2;
    Grant succeeded.
    SQL>  CONNECT TEST_2/TEST_2@SERVER
    Connected.
    SQL> CREATE TABLE TEST_COPY AS SELECT * FROM TEST_1.TEST_COPY;
    Table created.
    SQL>  SELECT * FROM TEST_COPY;
      TEST_COL
             1
             2Regards,
    Sandeep

  • How to use different parameters for two tables(chart and Table) in one report in SSRS?

    Hi,
    Here is my requirement, i have 7 parameters in my report(Site,Account,LOB,year,Month,WeekDay and Date_Filter),
    and in my report i have one table and one Chart,
    my requirement is the table in the report has to show the data for 6 parameters only i.e(Site,Account,LOB,year,Month and WeekDay).so the table has to consider only 6 parameters, and it has ignore the 7th parameter, table should not consider Date_Filter parameter.
    And Chart has to consider all 7 parameters.
    so, when we preview the report table has to show the data for only 6 parameters and chart has to show the data for all 7 parameters.
    if there is a way to get this Please reply me ASAP, it is an urgent requirement.
    Thanks in Advance,
    Naveen

    Hi Naveen,
    Refer below link to create multiple datasets as suggested by Gnanadurai
    http://technet.microsoft.com/en-us/library/ff714047(v=sql.105).aspx
    Thanks
    Swapna

  • How to delete all data in all tables in one time ?!

    1 CREATE OR REPLACE PROCEDURE delete_all_data
    2 IS
    3 v_statement VARCHAR2 (200);
    4 BEGIN
    5 FOR i IN (SELECT *
    6 FROM user_tables)
    7 LOOP
    8 v_statement :=
    9 'delete table ' || i.table_name ;
    10 EXECUTE IMMEDIATE v_statement;
    11 END LOOP;
    12 commit;
    13* END;
    SQL> /
    Procedure created.
    SQL> exec delete_all_data
    BEGIN delete_all_data; END;
    ERROR at line 1:
    ORA-00903: invalid table name
    ORA-06512: at "DE2.DELETE_ALL_DATA", line 10
    ORA-06512: at line 1
    I made the previous code , but it's didn't work with me .... any help for this problem please ?!
    I'm just reminder ..... all what I need ,that delete all data in all tables in one time only .
    I'm waiting for the answer ..... and thanks in advance

    create or replace
    FUNCTION TRUNC_SCHEMA RETURN NUMBER AS
    CURSOR select_table IS SELECT TABLE_NAME AS TNAME FROM USER_TABLES ORDER BY 1;
    sTableName Varchar2(128);
    sUser Varchar2(128);
    sConstraintName Varchar2(128);
    plsql_block Varchar2(512);
    BEGIN
    SELECT USER INTO sUser FROM DUAL;
    IF ((sUser='SYSTEM') OR (sUser='SYS')) THEN
    RETURN 1;
    END IF;
    EXECUTE IMMEDIATE 'PURGE RECYCLEBIN';
    -- DISABLE table's constraints
    FOR C1 IN (select CONSTRAINT_NAME, TABLE_NAME from user_constraints where STATUS = 'ENABLED' AND CONSTRAINT_TYPE in ('P','R') ORDER BY R_CONSTRAINT_NAME) LOOP
    sConstraintName := C1.CONSTRAINT_NAME;
    sTableName := C1.TABLE_NAME;
    plsql_block := 'ALTER TABLE ' || sTableName || ' DISABLE CONSTRAINT ' || sConstraintName;
    EXECUTE IMMEDIATE plsql_block ;
    END LOOP;
    FOR D IN select_table LOOP
    --get table name
    sTableName := D.TNAME;
    -- clear table
    plsql_block := 'TRUNCATE TABLE ' || sTableName;
    EXECUTE IMMEDIATE plsql_block ;
    END LOOP;
    -- ENABLE table's constraints
    FOR C2 IN (select CONSTRAINT_NAME, TABLE_NAME from user_constraints where STATUS = 'DISABLED' AND CONSTRAINT_TYPE in ('P','R') ORDER BY R_CONSTRAINT_NAME desc) LOOP
    sConstraintName := C2.CONSTRAINT_NAME;
    sTableName := C2.TABLE_NAME;
    plsql_block := 'ALTER TABLE ' || sTableName || ' ENABLE CONSTRAINT ' || sConstraintName;
    EXECUTE IMMEDIATE plsql_block ;
    END LOOP;
    RETURN 0;
    EXCEPTION WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE('ERROR: ' || SQLERRM);
    RETURN 1;
    END TRUNC_SCHEMA;
    /

Maybe you are looking for