Results 1 to 4 of 4

Thread: Why wont this Query Work?

  1. #1
    anicolais is offline Senior Member
    Join Date
    Nov 2009
    Posts
    99

    Default Why wont this Query Work?

    I am having troubles connecting the custom contacts fields to the contacts fields. Here is the query I'm trying to run

    select contacts_cstm.funnel_stage_c, contacts_cstm.funnel_description_c, contacts_cstm.funnel_date_c, contacts.first_name
    from contacts_cstm, contacts
    where contacts.ID = contacts_cstm.ID_c
    and contacts_cstm.funnel_stage_c is not null
    order by contacts_cstm.funnel_stage_c

    Every time I try to run this the server times out. Is this a problem with my query or a problem on the hosting side?

    MySQL
    Sugar 5.5
    Windows Vista

    Thanks

  2. #2
    eggsurplus's Avatar
    eggsurplus is offline Sugar Community Member
    Join Date
    Dec 2005
    Location
    Minnesota
    Posts
    2,343

    Default Re: Why wont this Query Work?

    If you add a 'limit 1,10' at the end does it not time out? If it does return then either the result set is too large or there is a problem with your host or more likely a combination of both.

  3. #3
    kuske's Avatar
    kuske is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Germany
    Posts
    2,597

    Default Re: Why wont this Query Work?

    How many contacts records do you have?
    How is your funnel_stage defined?
    If it is a big charfield this can take a long time to sort.
    You should create an index in contacts_cstm with id_c and funnale_stage_c.

    I would add a

    AND contacts.deleted=0

    to read only non deleted records.
    Harald Kuske
    Pre-Sales Engineer Central Europe

    SUGARCRM Deutschland GmbH
    Erika-Mann-Str. 53, 80636 Munich, Germany
    Email: hkuske@sugarcrm.com
    Home: http://www.sugarcrm.com


  4. #4
    wdroush is offline Senior Member
    Join Date
    Oct 2009
    Posts
    159

    Default Re: Why wont this Query Work?

    What happens when you punch it directly into the mysql database's command line? That wont time out and give you a total processing time.


    Also I'm picky
    Code:
    SELECT  contacts.first_name, contacts_cstm.funnel_stage_c, contacts_cstm.funnel_description_c, contacts_cstm.funnel_date_c
    FROM contacts
    LEFT JOIN contacts_cstm ON contacts_cstm.id_c=contacts.id
    WHERE contacts_cstm.funnel_stage_c is not null AND contacts.deleted=0
    ORDER BY contacts_cstm.funnel_stage_c

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 4
    Last Post: 2010-02-02, 04:36 PM
  2. Multiple customizations for same module wont work?
    By Gyro.Gearless in forum Installation and Upgrade Help
    Replies: 4
    Last Post: 2009-06-24, 09:22 AM
  3. SCRM wont work with firefox /linux ? go to hell!
    By henderson in forum General Discussion
    Replies: 3
    Last Post: 2008-04-17, 02:10 PM
  4. Replies: 2
    Last Post: 2006-10-20, 12:00 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •