Results 1 to 2 of 2

Thread: LARGE database

  1. #1
    Join Date
    Mar 2005
    Posts
    1

    Unanswered: LARGE database

    Hi,
    I am working with mysql.There are around 9 lack records in one table (invoice)and 50,000 records (custdata)in the other table.Big table has 8 fields and other has 4 fields.
    I want to retrieve those records from invoice whose CUST_NODE _ID matches with CUSTOMER _NODE_ID for a particular record.I am using following query-->

    Select a.*from invoice a, custdata b where b.ACCOUNT_ID = '20276783' and b.CUSTOMER_NODE_ID=a.CUST_NB.

    As soon as i run this query my database hangs.Can you suggest whats wrong?and how can i optimise i.e reduce select query executition time?

    Hope to hear soon from you.

    Regards,
    Swati

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    make sure that each of the three columns mentioned in your query has an index defined on it (but do not declare an index on a column that is already defined as a primary key)
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

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