PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Consistent overhead added to database

  1. I'm noticing that there is overhead added to the lead and lead_detail tables upon each form submission. I'm only using one form right now.

    Because I'm filing to a custom post type, I don't want the form entries to be saved. So I am using the following function to delete them:

    function remove_form_entry($entry, $form){
        global $wpdb;
        $lead_id = $entry['id'];
        $lead_table = RGFormsModel::get_lead_table_name();
        $lead_notes_table = RGFormsModel::get_lead_notes_table_name();
        $lead_detail_table = RGFormsModel::get_lead_details_table_name();
        $lead_detail_long_table = RGFormsModel::get_lead_details_long_table_name();
        //Delete from detail long
        $sql = $wpdb->prepare(" DELETE FROM $lead_detail_long_table
                                WHERE lead_detail_id IN(
                                    SELECT id FROM $lead_detail_table WHERE lead_id=%d
                                )", $lead_id);
        //Delete from lead details
        $sql = $wpdb->prepare("DELETE FROM $lead_detail_table WHERE lead_id=%d", $lead_id);
        //Delete from lead notes
        $sql = $wpdb->prepare("DELETE FROM $lead_notes_table WHERE lead_id=%d", $lead_id);
        //Delete from lead
        $sql = $wpdb->prepare("DELETE FROM $lead_table WHERE id=%d", $lead_id);
    add_action('gform_after_submission_1', 'remove_form_entry', 10, 2);

    Does that have anything to do with it? How does this affect performance? I know optimization of the database tables is something that should be done as part of maintenance, but will I need to monitor this all the time especially if I notice lag time on the site?

    Posted 4 years ago on Saturday January 7, 2012 | Permalink
  2. What caused you to look at this? Were you having performance issues?

    Posted 4 years ago on Tuesday January 10, 2012 | Permalink
  3. I was researching something else but started to notice each time I submitted something with the form the overhead was increasing each time. So I was wondering if this would affect performance?

    Posted 4 years ago on Wednesday January 11, 2012 | Permalink
  4. I don't think it will. MySQL is pretty smart. If you notice a performance issue, we're happy to take a look at it with you and see if we can make improvements.

    Posted 4 years ago on Wednesday January 11, 2012 | Permalink
  5. Hi,

    I'm interested in this too.

    In my app, I have no need for the entries or posts created by Gravity Forms. The reason is that I handle all the population & saving directly into a separate database, using hooks & filters.
    Therefore, GF is creating posts & entries for which I have no need.

    Q1. Can I delete everything in the rg_leads... tables ?
    Q2. Can I switch it off altogether ?
    Q3. Can I prevent GF from creating posts ?

    Many thanks,
    Jim Burke

    Posted 4 years ago on Tuesday March 6, 2012 | Permalink


Support Tickets

Open A New Support Ticket
 Open A New Priority Support Ticket *

* Developer license holders only