Use explain [INSERT YOUR SELECT STATEMENT]

Verify your using keys and if you are using keys ensure that the join say
eq_ref and the first key is const. If this is the case then this is the
fastest possible join you can do for the statement below.

--
DVP
> -----Original Message-----
> From: kamlesh pandey [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, April 21, 2004 1:10 PM
> To: [EMAIL PROTECTED]
> Subject: mysql using big two tables in BSD
> 
> Hi,
>   I'm new to mysql.
>   I have two big tables ,tableA>4GB and tableB>1GB.
>   both tables around 10 million rows,each.
> 
>   tableA has following two cols.
> 
>   user_id(varchar(255) PRIMARY KEY
>   user_data1(MEDIUMTEXT)
>   entries looks like
> 
>  user1 xyz................
>  user2 x1..................
> 
>  tableB has following cols
> 
>  user_data2:varchar(50)
>  user_id(varchar(255)).
> 
> tableB is indexed on (user_data2,user_id) and on
> user_id.
> there is no primary key in tableB since,it can have
> entries like
> A   user1
> B   user1
> A   user2
> C   user2.....
> 
> I NEED to SELECT data from both tables as follwoing
> 
> SELECT tableA.userid,tableA.user_data1 from
> tabelA,tableB where tableB.user_data2="myinput" AND
> tableB.user_id=tableA.user_id
> 
> It was good while the table size was small,but since
> the table size is big and growing,the query is
> becoming slow.
> I'm using  mysql_use_result().
> to get the result.
> 
> Any suggestion either on client query or server tuning
> will
> be helpful.
> 
> thanks
> 
> 
> 
> =====
> "Don't worry about the world coming to an end today. It's already tomorrow
> in Australia."
> 
> ¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°¤º°
> Do You Yahoo !
> ¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°¤º°
> 
> 
> 
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! Photos: High-quality 4x6 digital prints for 25¢
> http://photos.yahoo.com/ph/print_splash
> 
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
> http://lists.mysql.com/[EMAIL PROTECTED]




--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to