Select from remote server from stored procedure

2009-12-09 Thread Steven Staples
Ok, I feel silly for asking this, but I am going to do it anyway. I have a huge stored procedure that does quite a bit of logic, and gathering/splitting of data. I currently have our customer database on one server, and our logging on another. What i need to do, is to pull the customer id from

RE: Select from remote server from stored procedure

2009-12-09 Thread Neil Aggarwal
Is this possible to do? To make a connection, inside the stored procedure to a completely different machine and access the mysql there? The only way I know to access tables from different servers from a single connection is federated tables:

Re: Select from remote server from stored procedure

2009-12-09 Thread Johan De Meersman
Posted this before, but beware: federated tables do NOT use indices. Every select is a full table scan, and if you're talking about a logging table that could become very expensive very fast. On Wed, Dec 9, 2009 at 4:13 PM, Neil Aggarwal n...@jammconsulting.comwrote: Is this possible to do?

Re: Select from remote server from stored procedure

2009-12-09 Thread Harrison Fisk
Hello Johan, On Dec 9, 2009, at 11:22 AM, Johan De Meersman wrote: Posted this before, but beware: federated tables do NOT use indices. Every select is a full table scan, and if you're talking about a logging table that could become very expensive very fast. This is not entirely true.

RE: Select from remote server from stored procedure

2009-12-09 Thread Steven Staples
remote server from stored procedure Hello Johan, On Dec 9, 2009, at 11:22 AM, Johan De Meersman wrote: Posted this before, but beware: federated tables do NOT use indices. Every select is a full table scan, and if you're talking about a logging table that could become very expensive very fast

RE: Select from remote server from stored procedure

2009-12-09 Thread Neil Aggarwal
Steve: I suppose maybe making this a slave table to the other server... nah... lots of work there Setting your local server to be a slave of the remote server is not too hard and would be a MUCH better solution. The steps are fairly staightforward: 1. Add a slave user to the remote