Re: HOW QUERIES WORK

2007-08-14 Thread Ananda Kumar
Hi Krishna, The index combination ur using is not correct, please check the cardinality of the joining columns in the where condition and create the index also, you can use an "BETWEEN" clause instead of "date_format(ucp.payment_date,'%Y-%m-%d') >= '2001-12-12' and date_format(ucp.payment_date,'%Y-

Re: HOW QUERIES WORK

2007-08-14 Thread Baron Schwartz
Hi, MySQL is seeking into the operator_id index on crm_sales_contact and finding one or more matching rows where c.operator_id = 1. For each row it finds, it uses the value of contact_id to do a unique index lookup into crm_sales_contact's primary key. It then does a unique index lookup int

Re: HOW QUERIES WORK

2007-08-14 Thread krishna chandra prajapati
Hi, The details are as follows mysql> explain select ucp.user_id as RESULTANT_ID from user_course_payment ucp,crm_sales_contact sc, crm_contacts c where c.contact_id=sc.contact_idand c.product_id = sc.product_id and sc.product_id=1 and sc.resultant_id = ucp.user_id and sc.resultant_id !='' and c.

Re: HOW QUERIES WORK

2007-08-13 Thread Ananda Kumar
Hi Krishna, Its the bottom-up approach in all db's which follow SQL standards. Can u please show us the explain plan of the below query. regards anandkl On 8/14/07, krishna chandra prajapati <[EMAIL PROTECTED]> wrote: > > Hi all, > > i have to optimize complex join queries. i am not able to unde

HOW QUERIES WORK

2007-08-13 Thread krishna chandra prajapati
Hi all, i have to optimize complex join queries. i am not able to understand how the complex queries gets executed. Whether it follow top-down or bottom-up approach. There is millions of data. The queries is: select ucp.user_id as RESULTANT_ID from user_course_payment ucp,crm_sales_contact sc, c