Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2006
    Posts
    5

    Unanswered: slowness in query excution

    hello every 1
    can any one tell me ?

    the most likekly cause for slow execution of the statement.

    here are the table and qeury

    Table one
    module(module_id int, department char(15));

    Table two
    student(student_id int, name char(15), gender char(5));

    Table three
    Create table module_student(module_id int, student_id int, date_attended char(5));

    Statment

    Select distinc s.student_id
    From module m, module_student ms, student s
    Where m.module_id=m.ms.module_id
    And s.gender=’M’
    And m.department = ‘Computer science’;

    many thanx
    akshay

  2. #2
    Join Date
    Aug 2006
    Posts
    2
    If you have a large number of records in the tables, and the tables don't have any indexes, your query will run slow. Also I noticed that 'Computer science' is 16 characters long, and your quering a 15 character field.

    Hope this helps.

Posting Permissions

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