Results 1 to 3 of 3
  1. #1
    Join Date
    May 2004

    Question Unanswered: How to make JOIN more performant?


    I have a normalized MySQL database. Now I have a task to join all tables in the database, in order then to use universal query to it. I know that it is not a good idea, but in any case I must do it.

    I made LEFT OUTER JOIN to join tables. It looks like:
    SELECT * from language L
    LEFT JOIN (select documentId as docId,documentName,parentDocId,version,creationDat e,
    lastChanges,tiId,languageId as docLanguageId,description,readOnly,keywords,conten t,documentType from document)
    AS D on L.languageId=D.docLanguageId
    LEFT JOIN timeinterval TI on TI.tiId=D.tiId
    LEFT JOIN activity A on A.activityId= TI.activityId
    LEFT JOIN project P on P.projectId= TI.projectId
    LEFT JOIN groupproject GP on GP.projectId = P.projectId
    LEFT JOIN ugroup G on G.groupId = GP.groupId;

    I will not write the whole join, it is too big.

    It takes too much time to execute this query. Maybe somebody knows how to do it in more performant way, could you, please, help me?

    thank you in advance.

  2. #2
    Join Date
    Mar 2004
    Are your tables indexed? If not that is where you are losing all sorts of time on the join.

  3. #3
    Join Date
    May 2004
    no, I did not index. thank you for advice.

Posting Permissions

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