Inner Join between two big tables

Hi There,
I have a situation where in which I have to write an inner join between two table of the order of (30k to 60 rows).
My query is as simple as,
select A.a,B.b from A ,B where A.a = B.b;
N.B: a and b are of type varchar
But the problem is it takes nearly 15 mins to run. Is there any better way of doing an inner join between such bigger tables?
Thanks,
Jose John.

Thank you all for your help.....Indexing works....:)
--JJ                                                                                                                                                                                                   

Similar Messages

  • Can we apply join between two internal tables?

    Itab has fields A,B,C.
    Data: begin of itab occurs 1,
             A  type I,
             B type I,
             C type I,
             End of itab.
    Jtab has fields A, I, J.
    Data: begin of itab occurs 1,
             A  type I,
             I type I,
             J type I,
             End of itab
    The common field between itab and jtab is u201CAu201D.
    Now I need to collect A,B,C,I, J in another internal table ktab.
    How should I be doing this.
    If I use a SELECT query with inner join between itab and jtab it says u201Citab is not a database tableu201D.
    How should I get the result  ktab with A B C I J fields?
    Please help, nay help will be highly appreciated?

    a®s wrote:
    >
    > sort itab_all by A
    > delete adjacent duplicates from itab_all comparing A.
    >
    >
    Do you have the above code in ?
    Here A is common field between both tables, first we are appending itab_1 & itab_2 into table itab_all then deleting the adjacent duplicates from itab_all. then we are reading itab_1 & itab_2 for possible matches and update the same values in itab_all
    so there will NOT be a chance of duplicates in itab_all

  • Join between two nested tables question

    Hi. I have two nested tables with a join statement drawing info from both. The query looks like this:
    select to_char(N.LASTLOGONDATE, 'YYYY'), count(n.u_name), A.ACCOUNTDISABLED
    from coclastlogon, TABLE(COCLASTLOGON.RLLS) N , userpwaudit, TABLE(USERPWAUDIT.PVSS) A
    where N.U_NAME = A.USERNAME (+)
    and coclastlogon.AUDITID = 12
    and userpwaudit.AUDITID = 12
    group by to_char(N.LASTLOGONDATE, 'YYYY'), A.ACCOUNTDISABLED
    The query runs fine except its not generating non-matching values from the A.ACCOUNTDISABLED field. It is my understanding that placing the (+) will instruct the statement to add these columns to the result. If I use the same query with the same unnested data it produces the non-matching result set as I require.
    My feeling is there might be an issue with the way I've set my "FROM" but I'm not too sure how to proceed.
    Any suggestions?
    Thanks!

    You're right, by non-matching I mean null values.
    Running the query I wrote returns this result:
    (N.LASTLOGONDATE,'YYYY') / COUNT(N.U_NAME) / ACCOUNTDISABLED
    2005 3408 No
    2002 1 Yes
    Running the query using un-nested data returns this result (this is what I'm after):
    (N.LASTLOGONDATE,'YYYY') /COUNT(N.U_NAME) /ACCOUNTDISABLED
    2005 3408 No
    2002 1 Yes
    2005 27 -
    As you can see, the value I'm after is the one with ACCOUNTDISABLED 'null' value. Essentially, "coclastlogon, TABLE(COCLASTLOGON.RLLS) N" has more values in the N.U_NAME column than the table it is being joined to. That is why I added the (+). I just need to account for all values in TABLE(COCLASTLOGON.RLLS) than just the ones that find a join with "userpwaudit, TABLE(USERPWAUDIT.PVSS) A"

  • Joining on two large tables give breaks connections?

    I am doing inner join on two large tables (172,818 and 146,215) give breaks connections. Using Oracle 8.1.7.0.0
    ERROR at line 1:
    ORA-03113: end-of-file on communication channel
    Oraigannly I was trying to do alter table to add constrints, it gave the error aswell.
    ALTER TABLE a ADD (CONSTRAINT a_FK
    FOREIGN KEY (a_ID, a_VERSION)
    REFERENCES b(b_ID, b_VERSION)
    DEFERRABLE INITIALLY IMMEDIATE)
    Also gives same error. Trace file does not make sense to me.

    Thanks for the reply, no luck yet.
    SQL> show parameter optimizer_max_permutations ;
    NAME TYPE VALUE
    optimizer_max_permutations integer 80000
    SQL> show parameter resource_limit ;
    NAME TYPE VALUE
    resource_limit boolean FALSE
    SQL>

  • Subject: How to do join between two tables using something like SE16

    SE16, SE11 provide form based interface query information from a single table. Is there a way to do join between two tables without creating an infoset erc? I am looking for something similar to sql join but in SAP BI 7.0
    Thanks.

    Hi
    Pls look into below links. Hope this helps you.
    1. http://help.sap.com/saphelp_46c/helpdata/EN/d2/cb45bf455611d189710000e8322d00/content.htm
    2. http://help.sap.com/saphelp_46c/helpdata/EN/d2/cb45a5455611d189710000e8322d00/content.htm
    Regards
    Sirigiri

  • Bridge Table between two fact tables

    Hello everybody,
    From what I have read on the BI Administration tool help and on this forum, bridge tables are used to define many-to-many relations between dimension sand fact tables. Is it possible to have a bridge table defining a many-to-many relation between two fact tables?
    Here is my senario:
    1. We have a fact table called fact_Orders describing orders for some products.
    2. We have a fact table called fact_Sales describing sales og these products.
    3. We have a table describing the transformation from order lines to sales lines which is a many-to-many relation, because it is possible to transform an order in more than two steps.
    I was thinking of connecting the two fact tables with a bridge table.
    If bridge tables are inappropriate for this case, what could be a better model for my senario?
    Thanks for your time.

    Hi,
    Well a conformed dimension is a bridge table between two facts, so not sure why you need anything else. If there is a one to many from D1 to F1 and a one to many from D1 to F2 then effectively there is a many to many join from F1 to F2 through the D1 dimension.
    Sounds to me like all you need is an order dimension table, rows in the orders fact table will join to this dimension and so will rows in the sales fact table. You can then do calculations like number of sales per order, total sales revenue per order, # of order items per order etc etc.
    Regards,
    Matt

  • Multiple 'logical joins' between a fact table and one dimension table

    It appears that one cannot create multiple ‘logical joins’ between a fact table and one dimension table in OBIEE using the Oracle BI Administration Tool. For example, considering a Business Model with a dimension table TIMES and a fact table FACT containing START_TIME and END_TIME, we would like to create separate logical joins from FACT to TIMES for the START_TIMEs and END_TIMEs? Obviously, the underlying foreign keys can be created, but as far as I can tell the Oracle BI Administration Tool doesn’t support this. The workaround would be to replicate the TIMES table, but that’s ugly.
    I seek an alternative approach.

    Try this. Create an two aliases for the TIMES dimension (Start & End) in the Physical Layer and then remove foreign key to the "Parent" Times dimension. Create the Foreign Key in the Physical Layer to the new aliases and then create the complex joins in the BMM Layer to the new aliases as well. This will allow you to present both dates within the same table in the Presentation Layer. Not the most elegant solution but it works.

  • Joins between two schemas

    Hi
    I need data from two different schemas. Can develop one subject area taking 2 tables from 2 different schemas or we need to have these two tables from one schema only ?
    Can any one help on this.
    Thanks
    Manu

    Hi,
    When you try to create physical join between these two tables of different schemas.
    The join condition is REGION.REGION_CODE = REGION.REGION_ID
    Note: The table name is same in both the schema.
    Now as soon as I click on Ok, it gives an error.Because You can not create join between two tables with the same name.
    So, create alias for these two tables and try to create the join with the same join condition.
    It allowed me to create join perfectly. I moved ahead with the creation of Subject Area based out of these two tables.
    Opened Presentation Services, selected few attributes from both the Presentation folders.But it gave ODBC error as :
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 46036] Internal Assertion: Condition m_CountFields == static_cast<int32>(m_ColumnNameVector.size()), file .\Src\SQCSCacheStorageListStream.cpp, line 221. (HY000)
    Now in order to fix that issue, rename the base tables as Schema1_name.REGION and Schema2_name.REGION in the repository.
    Reload the rpd and run the same report, it would give correct result.
    But instead you can have the tables in the same schema for better maintenance activities.
    Hope this solved your question.
    Regards
    MuRam

  • Error while running code template mapping between two oracle tables

    Hello All
    Iam getting the following error while running code template mapping between two oracle tables. Using OWB 11gR2 and oracle 11gR2 DB.
    java.sql.SQLException: ORA-20001: The active workspace is not valid as a target for this mapping
    c: at "OWBSYS.WB_RT_MAPAUDIT_UTIL", line 1065
    ORA-06512: at "OWBSYS.WB_RT_MAPAUDIT_UTIL", line 1087
    ORA-06512: at "SOURCE.FILENET_EX_UNIT_3", line 555
    ORA-06512: at line 4                                        
    Job 51 error: java.sql.SQLException: ORA-20001: The active workspace is not valid as a target for this mapping
    ORA-06512: at "OWBSYS.WB_RT_MAPAUDIT_UTIL", line 1065
    ORA-06512: at "OWBSYS.WB_RT_MAPAUDIT_UTIL", line 1087
    ORA-06512: at "SOURCE.FILENET_EX_UNIT_3", line 555
    ORA-06512: at line 4
    Quick help is highly appreciated.

    Dera Dallan
    its only a target user for the workspace where you are deploying the mapping from.
    I have two repositories for two different projects. each repositary has its own workspace.
    ex:-
    Project 1
    Work space bpms_rep_owner
    Repositary owner bpms_rep_owner
    Repositary user bpms_rep_user
    Project 2
    Work space dem_rep_owner
    Repositary owner dem_rep_owner
    Repositary user dem_rep_user
    Reg
    S.Gyazuddin

  • Find the difference between two internal table

    how can i see the difference between two interal tables?
    The requirement is as follows
    1. We have a transparent table, which stores the employee data with EMP ID as key.
    2. We load the transp table data into a interal table (B).
    3. We get data from legecy system as file and it gets loaded into another internal table (A) (this also has the same EMP ID key and this will have latest addition/update to those emplyees).
    Now we need to seperate out these data into three interal table Inserted (I), Deleted (D) and Updated (U).
    We want to do followign things
    I = A - B
    D = B - A
    Both A and B will have around 40k records. Hence we are trying to avoid the looping.
    Please suggest the best option for us.
    Thank you in advance.
    Raghavendra

    >
    RAGHAV URAL wrote:
    > how can i see the difference between two interal tables?
    > The requirement is as follows
    >
    > 1. We have a transparent table, which stores the employee data with EMP ID as key.
    > 2. We load the transp table data into a interal table (B).
    > 3. We get data from legecy system as file and it gets loaded into another internal table (A) (this also has the same EMP ID key and this will have latest addition/update to those emplyees).
    >
    > Now we need to seperate out these data into three interal table Inserted (I), Deleted (D) and Updated (U).
    >
    > We want to do followign things
    > I = A - B
    > D = B - A
    >
    > Both A and B will have around 40k records. Hence we are trying to avoid the looping.
    >
    > Please suggest the best option for us.
    >
    > Thank you in advance.
    > Raghavendra
    Hi Raghavendra,
      Currently as of my knowledge, these operations are only possible through LOOPs. But LOOPign can be really fast here if you properly utilize the SORTING, READ with BINARY SEARCH and FIELD-SYMBOLS usage. I would say:-
    Steps for Insert:-
    SORT: A, B.
    LOOP AT A ASSIGNING <WA_A>.
      READ TABLE B WITH TABLE KEY key = <WA_A>-key BINARY SEARCH.
      IF SY-SUBRC NE 0.
        APPEND <WA_A> TO I.
      ENDIF.
    ENDLOOP.
    Steps for Delete:-
    SORT: A, B.
    LOOP AT B ASSIGNING <WA_B>.
      READ TABLE A WITH TABLE KEY key = <WA_B>-key BINARY SEARCH.
      IF SY-SUBRC NE 0.
        APPEND <WA_B> TO D.
      ENDIF.
    ENDLOOP.
    Regards,
    Ravi.

  • Need to eliminate Space between two Pivot table view  in OBIEE 11g

    Hi,
    I have a requirement to eliminate space between two pivot table views. In a single report I have two Pivot table with two different column, I placed both of them one after another, but I need to eliminate the space between two pivot table views as if it should show as a single pivot table in OBIEE 11g.
    Could anyone please let me know how I can do this in OBIEE 11g?
    Thanks in Advance
    Anirban Mitra

    If I create narrative view it will be another view. And if I put that in between that two pivot view, it will show the space. I need to remove space between two pivot table within a single report so that it can appear as a single pivot view.
    Thanks

  • Performance between two partitionned tables with different structure

    Hi,
    I would like if there is a difference between two partitionned tables with different structure in term of performance (access, query, insertions, updates ).
    I explain myself in detail :
    I have a table that stores one value every 10 minutes in a day (so we have 144 values (24*6) in the whole day), with the corresponding id.
    Here is the structure :
    | Table T1 |
    + id PK |
    + date PK |
    + sample1 |
    + sample2 |
    + ... |
    + sample144 |
    The table is partionned on the column date, with a partionned every months. The primary key is based on the columns (id, date).
    There is an additionnal index on the column (id) (is it useful ?).
    I would like to know if it is better to have a table with just (id, date, value) , so for one row in the first table we'll have 144 rows in the future? table. The partition will already be on the columns (id, date) with the index associated.
    What are the gains or loss in performance with this new structure ( access, DMLs , storage ) ?
    I discuss with the Java developers and they say it is simpler to manage in their code.
    Oracle version : Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    Thanks & Regards
    From France
    Oliver
    Edited by: 998239 on 5 avr. 2013 01:59

    I mean storage in tablespaces and datafiles on disk.
    Can you justify please and give me concrete arguments why the two structures are equivalent ( except inserting data in T(id, date,value))
    because i have to make a report.i didnt say any thing like
    two structures are equivalent ( except inserting data in T(id, date,value)i said
    About structure : TABLE1(id, date, value) is better than TABLE1(id, date, sample1, .... sample144)because
    1) oracle has restriction for numbers of column. Ok you can have 144 columns now but for future if you must have more than 1000 columns , what will you do?
    2) Restrictions on Table Compression (Table compression is not supported for tables with more than 255 columns.)
    3) store same type values on diffrent columns is bad practise
    http://docs.oracle.com/cd/B28359_01/server.111/b28318/schema.htm#i4383
    i remember i seen Toms article about this but now i cant find it sorry ((( if i found i will post here

  • EXCHANGE SUBPARTITION between two Partitioned tables

    DB Version: 10.2.0.5
    We have :
    Table A(Range-List Partitioned):
    Partition A1 -> Sub-Partition S1A1 and S2A1
    Partition A2 -> Sub-Partition S1A2 and S2A2
    Table B(Range-List Partitioned):
    Partition B1 -> Sub-Partition S1B1 and S2B1
    Partition B2 -> Sub-Partition S1B2 and S2B2
    I would like to EXCHANGE SUBPARITION A.S1A1 with B.S1B1, and S2A1 with S2B1 and S1A2 with S1B2 ...so on. Which means, how do I exchange subpartitions between two similar tables?
    The following statement does not work...
    ALTER TABLE A EXCHANGE SUBPARTITION S1A1
    WITH TABLE B SUBPARTITION S1B1 INCLUDING INDEXES;
    Please advice.

    Hi,
    ALTER TABLE A EXCHANGE SUBPARTITION S1A1 WITH TABLE B INCLUDING INDEXES;
    Read the document
    http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10739/partiti.htm
    Regards
    Hitgon

  • The order doesn't work in my view with join between two lists. And now?

    Hi,
    I work with sharepoint 2010.
    I did the join between two list follow this
    post.
    I did it and everything is ok, but the order doesn't work.
    What can be it?
    Thanks
    K2rto'4 - Analista Sharepoint
    "Hoje melhor do que ontem, amanhã melhor do que hoje!" 改 善

    Hi,
    I've two lists in my view with join. The list A and the list B.
    I'm ordering the view with the column list A.
    The column list A it's a column for type lookup to list B's column.
    In my view i'm ordering with the column list A of type lookup.
    The view with join is not ordering in order growing.
    I want the view will be ordering by order growing.
    Do you understood?
    Hugs
    K2rto'4 - Analista Sharepoint
    "Hoje melhor do que ontem, amanhã melhor do que hoje!" 改 善

  • Intervals, synchronize the data between two oracle tables located in diffe

    Hi Experts,
    Is there any way I can, at set intervals, synchronize the data between two oracle tables located in different servers? What is the software, if there is any? If there are steps I can follow, so much the better.
    Thanks!

    I'm not sure what you want to achieve here...
    I want to synchronize both the Servers , so that it can update HO servers as well as Factory Server with the complete data. Could you please elaborate a little bit more; basing on your description I could also tell you how to setup timesync for those two servers if I understand "complete data" as the current date and time...
    Also a lot of solutions are platform and version specific so it would help if you could indicate OS and Database Versions (4 digit).
    And I still fail to see what this has to do with forms. You might want to post your question to the Database General forum: General Database Discussions
    cheers

Maybe you are looking for

  • How can I enforce automatic spell checking for selected fields of data entered by form users?

    I'd like to be able to enforce spell checking of selected fields in the forms that I've created using LiveCycle Designer 8.2 at run time, as opposed to design time.  I understand the version LCD 8 has a nifty new spell checker for form designers.  Bu

  • Resize image in pdf file

    I need to resize image in pdf , I get this [http://www.java2s.com/Tutorial/Java/0419__PDF/Positionandresizeanimage.htm] I try to put the code in my servlet but I get error on not static method on PdfContentByte cb = writer.getDirectContent(); how to

  • Upgraded to iOS6 and now charging cable doesn't work

    I just upgraded to iOS6 n my iPhone 4, and now my charging cable doesn't work.  No...it's not an "official" Apple charger, but even the usb cable doesn't work when I plug it into my computer.  If I plug my iPad charger into it, it works fine.  How ca

  • Error in Previous Employer Details (IT 0023) in Recruitment

    Dear Friends, When I try to save IT 0023 (Previous Employer Details) in Recruitment in Enter Additional Data action, I am getting the following error message: u201CPrevious Employment Date canu2019t be greater than hiring date 00000000u201D Please ad

  • New install of CS3 on my new Mac OSX Lion does not start

    Good morning, I have an old Mac running CS3, that was upgraded to Lion afterwards with no difficulty. I bought a new Mac 27" Mac OSX Lion, when installing CS3 on it, the licence number does not register a green check (horrible red cross instead....)