Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2002
    Location
    Cochin, INDIA
    Posts
    9

    Unanswered: Query Optimisation

    I have 3 tables with the following schema.

    TABLEA
    ======
    COLUMNA
    COLUMNB
    COLUMNC
    COLUMNX

    TABLEB
    ======
    COLUMNA
    COLUMNB
    COLUMNC
    COLUMNX

    TABLEC
    ======
    COLUMND
    COLUMNE
    COLUMNF
    COLUMNX

    select A.COLUMNA, A.COLUMNB, A.COLUMNC, C.COLUMND, C.COLUMNE, C.COLUMNF from TABLEA A, TABLEC C where C.COLUMNX = A.COLUMNX and A.COLUMNA = 'VALUE'

    select B.COLUMNA, B.COLUMNB, B.COLUMNC, C.COLUMND, C.COLUMNE, C.COLUMNF from TABLEB B, TABLEC C where C.COLUMNX = B.COLUMNX and B.COLUMNA = 'VALUE'

    Can any of you suggest me to have optimised, JOIN query with regard to the SQLs mentioned above

    Thanking in advance,
    Saju Joseph

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1

    Re: Query Optimisation

    I don't understand the question! Do you mean you want to JOIN the first query to the second? Or UNION them together? Or something else?

  3. #3
    Join Date
    Nov 2002
    Posts
    3
    You can download a copy of SQL Expert or DB Expert from leccotech.com to optimize your query. Without the detail information about your database, no one can help you to optimize your SQL.

  4. #4
    Join Date
    Sep 2002
    Location
    ITALY
    Posts
    53

    Re: Query Optimisation

    At least you should try this:

    create index on restrictions (usually PK/Unique but it's not mandatory) ad on FKs, so you have to index the following:
    Ta (Ca)
    Tb (Cb)
    Tc (Cx)

    best regards

    Originally posted by peruvachira
    I have 3 tables with the following schema.

    select A.COLUMNA, A.COLUMNB, A.COLUMNC, C.COLUMND, C.COLUMNE, C.COLUMNF from TABLEA A, TABLEC C where C.COLUMNX = A.COLUMNX and A.COLUMNA = 'VALUE'

    select B.COLUMNA, B.COLUMNB, B.COLUMNC, C.COLUMND, C.COLUMNE, C.COLUMNF from TABLEB B, TABLEC C where C.COLUMNX = B.COLUMNX and B.COLUMNA = 'VALUE'

    Can any of you suggest me to have optimised, JOIN query with regard to the SQLs mentioned above

    Thanking in advance,
    Saju Joseph
    Franco Ceotto
    SIPTI srl
    OnSite Services
    9i OCP DBA, Performance Engineer

  5. #5
    Join Date
    Sep 2002
    Location
    ITALY
    Posts
    53

    Re: Query Optimisation

    Sorry, i mistyped the reply, the correct idea is -obviously- the following:
    Ta (Ca)
    Tb (Ca)
    Tc (Cx)

    Originally posted by franco.ceotto
    At least you should try this:

    create index on restrictions (usually PK/Unique but it's not mandatory) ad on FKs, so you have to index the following:
    Ta (Ca)
    Tb (Cb)
    Tc (Cx)

    best regards
    Franco Ceotto
    SIPTI srl
    OnSite Services
    9i OCP DBA, Performance Engineer

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •