ApatarForge
Apatar.com  |  Log In   

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups    RegisterRegister 
  ProfileProfile     Log in to check your private messagesLog in to check your private messages    Log inLog in  

Slow Join

 
Post new topic   Reply to topic    Apatar Community Forums Forum Index -> Help
View previous topic :: View next topic  
Author Message
adminaia



Joined: 27 Apr 2009
Posts: 5

PostPosted: Thu Mar 15, 2012 11:18 am    Post subject: Slow Join Reply with quote

Hello!
I'm working with apatar for a week and i think it is easy to learn. Brings fast solutions.
But today i faced a big problem while JOINING two MYSQL tables with about 370k records in. Each!

I build a first connector to table CONTACT and a second one to table ADRESS. Joining them all took hours (days?). I killed the job meanwhile.

Reducing the amount of values with WHERE lastname = 'smith' in table1 and where country = 'italy' in table2 will produce a fast result.

My second approach was to use the generic ODBC connector for mysql. It is faster to configure but i can not select different values with WHERE.

Any idea how to speed up?
Back to top
View user's profile Send private message
Sergei



Joined: 26 Jul 2007
Posts: 969

PostPosted: Thu Mar 15, 2012 12:57 pm    Post subject: Reply with quote

Hello,

You may try to write SQL query within MySQL connector to join two tables instead of using Join node. It would definitely speed up the process.
_________________
Regards,
Sergei
Back to top
View user's profile Send private message Send e-mail Visit poster's website
adminaia



Joined: 27 Apr 2009
Posts: 5

PostPosted: Fri Mar 16, 2012 8:21 am    Post subject: Reply with quote

Thanks for your answer,
it is pretty fast now! Smile
Back to top
View user's profile Send private message
adminaia



Joined: 27 Apr 2009
Posts: 5

PostPosted: Mon Mar 19, 2012 8:34 am    Post subject: Reply with quote

Ok, but actually I faced a problem joining 3 tables with inner join.

Two tables work fine:
Select * From `vtiger_contactdetails` Inner Join `vtiger_contactaddress` On contactid = contactaddressid

But this won't:
Select * From (`vtiger_contactdetails` Inner Join `vtiger_contactaddress` On contactid = contactaddressid) Inner Join `vtiger_contacscf` on vtiger_contactdetails.contactid = vtiger_contactcf.contactid

Or can I access a MySQL-View somehow?
Back to top
View user's profile Send private message
adminaia



Joined: 27 Apr 2009
Posts: 5

PostPosted: Wed Mar 21, 2012 9:38 am    Post subject: Reply with quote

I speed up Join-Node #1 by filtering my 1st MySql-Node.
And my second Join-Node has only 20.000 values to match.

But it would be very nice if someone could check how to JOIN
3 tables in ONE SQL-Node.

Greetings
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Apatar Community Forums Forum Index -> Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group