will multi-db take care of complex joins and unions?

Hi,

I just want to know, if multi-db plugin takes care of complex joins, subqueries and unions in the query?

  • Andrew
    • Champion of Loops

    Hiya,

    It really depends on the queries. For example, a join across two global tables should work just fine. However, a join across a global table and a blog table most likely wouldn't work.

    I'd suggest setting up a test install and testing your code before doing anything to your live site.

    Thanks,
    Andrew

  • Shashank
    • New Recruit

    Hi,

    I deployed multi-db plugin in our 1.3.3 wpmu version.. and got the following error.. am i missing any where?

    [08-Mar-2009 00:39:16] WordPress database error No database selected for query SELECT * FROM wp_site made by require_once
    [08-Mar-2009 00:39:16] WordPress database error No database selected for query SELECT * FROM wp_site WHERE (domain = '' OR domain='') AND path='/blogs/' made by wpmu_current_site
    [08-Mar-2009 00:39:16] WordPress database error No database selected for query SELECT * FROM wp_site WHERE (domain = '' OR domain='') AND path='/' made by wpmu_current_site

  • Andrew
    • Champion of Loops

    Hiya,

    I'm honestly not sure what's causing those errors but what stands out is your version of WPMU. 1.3.3 was released over a year ago I believe.

    The oldest version of Multi-DB that we have available for download is 1.0.1 which is compatible with WPMU 1.5.1.

    If absolutely necessary I can probably dig up an older version of Multi-DB for you. However, I'm afraid we can't offer support for a version we don't even provide anymore.

    Even taking Multi-DB out of the picture you still need to upgrade just for the security fixes over the past year.

    Thanks,
    Andrew

  • Shashank
    • New Recruit

    Thanks andrew.. we had done lot of customizations in 1.3.3 and we are about to release it soon.. however, we have plans to further upgrade it to latest one along with buddypress..

    I went through the code, and have the following idea..

    i will initialise all $wpdb variables as <dbname>.<tablename> .. and i will make sure, in all the queries, the db variable (like $wpdb->blogs) are used..
    i would use the existing wpdb.php file.. since every table name of all query is used as <dbname>.<tablename> i feel, it will workout in the current setup.. as of now, i will be using only one db server..

    Will this work out?

  • Shashank
    • New Recruit

    Andrew,

    Just wanted to tell you that I tried that option and it works fine for me. However, i have to test it extensively to find if there is any issue..

    The only pre-condition for this is that all queries should use table names from $wpdb-> variable..

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.