Jump to content


Alberto

Member Since 18 Nov 2015
Offline Last Active Apr 26 2018 10:32 PM
-----

Topics I've Started

Source email not associated with newly created contact

20 August 2017 - 09:48 PM

When creating a new contact from an email in the X2CRM email client, the source email itself is not associated with the new contact. The expected intuitive behavior is that if I received an email from a person not already in the CRM and I created the contact from this source, this source email would be automatically associated with the record for future reference.

 


MySQL Query Performance Issue - x2crm 6.9

12 August 2017 - 06:31 PM

Hello, I have been dealing with a performance crippling situation with X2CRM related to MySQL queries to the 'x2_trigger_logs' table. This manifests specifically whenever we interact with tags on records, such as adding a single tag to a contact.

 

I wrote a simple PHP script that uses X2CRM's API to test performance of Create, Lookup, Update, Delete and saw the following poor performance:

08-11-2017 22:28:33.190000 Creating contact.
08-11-2017 22:28:34.310000 Done.

08-11-2017 22:28:34.310000 Lookup contact.
08-11-2017 22:28:34.360000 Done.

08-11-2017 22:28:34.360000 Adding tag to contact.
08-11-2017 22:28:43.750000 Done.

08-11-2017 22:28:43.750000 Adding note to contact.
08-11-2017 22:28:45.940000 Done.

08-11-2017 22:28:45.940000 Deleting contact.
08-11-2017 22:28:49.780000 Done.

Total time elapsed: 16.5868570805 seconds.

As seen above, most of the 16 seconds is taken up with the "add tag" operation.

 

I have been working with our server admin to help isolate the issue and have identified the following query to be the cause:

SELECT COUNT(*) FROM x2_trigger_logs t;

We logged slow queries in MySQL and found that this particular query seems to be called 74 times when adding 1 tag to a contact in our case. Each query execution time is measured to be 0.16 seconds:

mysql> SELECT COUNT() FROM x2_trigger_logs t;
+----------+
| COUNT() |
+----------+
| 500000 |
+----------+
1 row in set (0.16 sec)

Below we can see the slow log timings for one "add tag to contact" operation:

# Query_time: 0,108733 Lock_time: 0,000667 Rows_sent: 0 Rows_examined: 0
# Query_time: 0,143326 Lock_time: 0,000117 Rows_sent: 1 Rows_examined: 500001
# Query_time: 0,020223 Lock_time: 0,000090 Rows_sent: 0 Rows_examined: 1
# Query_time: 0,023354 Lock_time: 0,000123 Rows_sent: 0 Rows_examined: 1
# Query_time: 0,110335 Lock_time: 0,000081 Rows_sent: 1 Rows_examined: 500000
# Query_time: 0,046776 Lock_time: 0,000095 Rows_sent: 0 Rows_examined: 0
# Query_time: 0,114055 Lock_time: 0,000076 Rows_sent: 1 Rows_examined: 500001
# Query_time: 0,050419 Lock_time: 0,000041 Rows_sent: 0 Rows_examined: 1
# Query_time: 0,023053 Lock_time: 0,000090 Rows_sent: 0 Rows_examined: 1
# Query_time: 0,115704 Lock_time: 0,000066 Rows_sent: 1 Rows_examined: 500000
# Query_time: 0,024761 Lock_time: 0,000089 Rows_sent: 0 Rows_examined: 0
# Query_time: 0,126456 Lock_time: 0,000071 Rows_sent: 1 Rows_examined: 500001
# Query_time: 0,029691 Lock_time: 0,000043 Rows_sent: 0 Rows_examined: 1
# Query_time: 0,022982 Lock_time: 0,000085 Rows_sent: 0 Rows_examined: 1
# Query_time: 0,122913 Lock_time: 0,000068 Rows_sent: 1 Rows_examined: 500000
# Query_time: 0,042518 Lock_time: 0,000119 Rows_sent: 0 Rows_examined: 0
# Query_time: 0,110395 Lock_time: 0,000068 Rows_sent: 1 Rows_examined: 500001
# Query_time: 0,054122 Lock_time: 0,000039 Rows_sent: 0 Rows_examined: 1
# Query_time: 0,023069 Lock_time: 0,000107 Rows_sent: 0 Rows_examined: 1
# Query_time: 0,114085 Lock_time: 0,000065 Rows_sent: 1 Rows_examined: 500000
# Query_time: 0,043029 Lock_time: 0,000102 Rows_sent: 0 Rows_examined: 0
# Query_time: 0,120918 Lock_time: 0,000077 Rows_sent: 1 Rows_examined: 500001
# Query_time: 0,035168 Lock_time: 0,000034 Rows_sent: 0 Rows_examined: 1
# Query_time: 0,023252 Lock_time: 0,000083 Rows_sent: 0 Rows_examined: 1
# Query_time: 0,121647 Lock_time: 0,000070 Rows_sent: 1 Rows_examined: 500000
# Query_time: 0,043686 Lock_time: 0,000088 Rows_sent: 0 Rows_examined: 0
# Query_time: 0,120966 Lock_time: 0,000073 Rows_sent: 1 Rows_examined: 500001
# Query_time: 0,035233 Lock_time: 0,000034 Rows_sent: 0 Rows_examined: 1
# Query_time: 0,023241 Lock_time: 0,000088 Rows_sent: 0 Rows_examined: 1
# Query_time: 0,113551 Lock_time: 0,000067 Rows_sent: 1 Rows_examined: 500000
# Query_time: 0,051815 Lock_time: 0,000088 Rows_sent: 0 Rows_examined: 0
# Query_time: 0,129238 Lock_time: 0,000075 Rows_sent: 1 Rows_examined: 500001
# Query_time: 0,026755 Lock_time: 0,000052 Rows_sent: 0 Rows_examined: 1
# Query_time: 0,022935 Lock_time: 0,000094 Rows_sent: 0 Rows_examined: 1
# Query_time: 0,135328 Lock_time: 0,000071 Rows_sent: 1 Rows_examined: 500000
# Query_time: 0,030015 Lock_time: 0,000109 Rows_sent: 0 Rows_examined: 0
# Query_time: 0,133382 Lock_time: 0,000074 Rows_sent: 1 Rows_examined: 500001
# Query_time: 0,031044 Lock_time: 0,000044 Rows_sent: 0 Rows_examined: 1
# Query_time: 0,022996 Lock_time: 0,000092 Rows_sent: 0 Rows_examined: 1
# Query_time: 0,121591 Lock_time: 0,000068 Rows_sent: 1 Rows_examined: 500000
# Query_time: 0,043867 Lock_time: 0,000090 Rows_sent: 0 Rows_examined: 0
# Query_time: 0,120075 Lock_time: 0,000067 Rows_sent: 1 Rows_examined: 500001
# Query_time: 0,036094 Lock_time: 0,000045 Rows_sent: 0 Rows_examined: 1
# Query_time: 0,022999 Lock_time: 0,000096 Rows_sent: 0 Rows_examined: 1
# Query_time: 0,126852 Lock_time: 0,000067 Rows_sent: 1 Rows_examined: 500000
# Query_time: 0,038542 Lock_time: 0,000106 Rows_sent: 0 Rows_examined: 0
# Query_time: 0,123067 Lock_time: 0,000101 Rows_sent: 1 Rows_examined: 500001
# Query_time: 0,041513 Lock_time: 0,000043 Rows_sent: 0 Rows_examined: 1
# Query_time: 0,023012 Lock_time: 0,000089 Rows_sent: 0 Rows_examined: 1
# Query_time: 0,114935 Lock_time: 0,000066 Rows_sent: 1 Rows_examined: 500000
# Query_time: 0,050427 Lock_time: 0,000094 Rows_sent: 0 Rows_examined: 0
# Query_time: 0,125180 Lock_time: 0,000103 Rows_sent: 1 Rows_examined: 500001
# Query_time: 0,031061 Lock_time: 0,000035 Rows_sent: 0 Rows_examined: 1
# Query_time: 0,023015 Lock_time: 0,000089 Rows_sent: 0 Rows_examined: 1
# Query_time: 0,114702 Lock_time: 0,000068 Rows_sent: 1 Rows_examined: 500000
# Query_time: 0,050768 Lock_time: 0,000098 Rows_sent: 0 Rows_examined: 0
# Query_time: 0,116401 Lock_time: 0,000069 Rows_sent: 1 Rows_examined: 500001
# Query_time: 0,039639 Lock_time: 0,000042 Rows_sent: 0 Rows_examined: 1
# Query_time: 0,022856 Lock_time: 0,000101 Rows_sent: 0 Rows_examined: 1
# Query_time: 0,134674 Lock_time: 0,000072 Rows_sent: 1 Rows_examined: 500000
# Query_time: 0,030727 Lock_time: 0,000089 Rows_sent: 0 Rows_examined: 0
# Query_time: 0,116739 Lock_time: 0,000069 Rows_sent: 1 Rows_examined: 500001
# Query_time: 0,047695 Lock_time: 0,000041 Rows_sent: 0 Rows_examined: 1
# Query_time: 0,047473 Lock_time: 0,000107 Rows_sent: 0 Rows_examined: 1
# Query_time: 0,127621 Lock_time: 0,000075 Rows_sent: 1 Rows_examined: 500000
# Query_time: 0,037800 Lock_time: 0,000090 Rows_sent: 0 Rows_examined: 0
# Query_time: 0,115011 Lock_time: 0,000065 Rows_sent: 1 Rows_examined: 500001
# Query_time: 0,049486 Lock_time: 0,000042 Rows_sent: 0 Rows_examined: 1
# Query_time: 0,022797 Lock_time: 0,000094 Rows_sent: 0 Rows_examined: 1
# Query_time: 0,127977 Lock_time: 0,000075 Rows_sent: 1 Rows_examined: 500000
# Query_time: 0,037516 Lock_time: 0,000090 Rows_sent: 0 Rows_examined: 0
# Query_time: 0,110380 Lock_time: 0,000067 Rows_sent: 1 Rows_examined: 500001
# Query_time: 0,054164 Lock_time: 0,000035 Rows_sent: 0 Rows_examined: 1
# Query_time: 0,023125 Lock_time: 0,000117 Rows_sent: 0 Rows_examined: 1
# Query_time: 0,122504 Lock_time: 0,000068 Rows_sent: 1 Rows_examined: 500000
# Query_time: 0,042859 Lock_time: 0,000091 Rows_sent: 0 Rows_examined: 0
# Query_time: 0,128829 Lock_time: 0,000076 Rows_sent: 1 Rows_examined: 500001
# Query_time: 0,027380 Lock_time: 0,000070 Rows_sent: 0 Rows_examined: 1
# Query_time: 0,023089 Lock_time: 0,000121 Rows_sent: 0 Rows_examined: 1
# Query_time: 0,122215 Lock_time: 0,000067 Rows_sent: 1 Rows_examined: 500000
# Query_time: 0,043164 Lock_time: 0,000092 Rows_sent: 0 Rows_examined: 0
# Query_time: 0,127072 Lock_time: 0,000071 Rows_sent: 1 Rows_examined: 500001
# Query_time: 0,029135 Lock_time: 0,000034 Rows_sent: 0 Rows_examined: 1
# Query_time: 0,023047 Lock_time: 0,000089 Rows_sent: 0 Rows_examined: 1
# Query_time: 0,113734 Lock_time: 0,000087 Rows_sent: 1 Rows_examined: 500000
# Query_time: 0,051643 Lock_time: 0,000089 Rows_sent: 0 Rows_examined: 0
# Query_time: 0,116783 Lock_time: 0,000068 Rows_sent: 1 Rows_examined: 500001
# Query_time: 0,047555 Lock_time: 0,000039 Rows_sent: 0 Rows_examined: 1
# Query_time: 0,022892 Lock_time: 0,000095 Rows_sent: 0 Rows_examined: 1
# Query_time: 0,137589 Lock_time: 0,000079 Rows_sent: 1 Rows_examined: 500000
# Query_time: 0,027725 Lock_time: 0,000091 Rows_sent: 0 Rows_examined: 0
# Query_time: 0,114247 Lock_time: 0,000081 Rows_sent: 1 Rows_examined: 500001
# Query_time: 0,050185 Lock_time: 0,000035 Rows_sent: 0 Rows_examined: 1
# Query_time: 0,022840 Lock_time: 0,000096 Rows_sent: 0 Rows_examined: 1
# Query_time: 0,141953 Lock_time: 0,000074 Rows_sent: 1 Rows_examined: 500000
# Query_time: 0,023370 Lock_time: 0,000094 Rows_sent: 0 Rows_examined: 0
# Query_time: 0,112142 Lock_time: 0,000067 Rows_sent: 1 Rows_examined: 500001
# Query_time: 0,044138 Lock_time: 0,000038 Rows_sent: 0 Rows_examined: 1
# Query_time: 0,022989 Lock_time: 0,000120 Rows_sent: 0 Rows_examined: 1
# Query_time: 0,133209 Lock_time: 0,000078 Rows_sent: 1 Rows_examined: 500000
# Query_time: 0,032129 Lock_time: 0,000094 Rows_sent: 0 Rows_examined: 0
# Query_time: 0,121637 Lock_time: 0,000074 Rows_sent: 1 Rows_examined: 500001
# Query_time: 0,042797 Lock_time: 0,000045 Rows_sent: 0 Rows_examined: 1
# Query_time: 0,022903 Lock_time: 0,000095 Rows_sent: 0 Rows_examined: 1
# Query_time: 0,124094 Lock_time: 0,000093 Rows_sent: 1 Rows_examined: 500000
# Query_time: 0,041362 Lock_time: 0,000092 Rows_sent: 0 Rows_examined: 0
# Query_time: 0,126776 Lock_time: 0,000073 Rows_sent: 1 Rows_examined: 500001
# Query_time: 0,037710 Lock_time: 0,000043 Rows_sent: 0 Rows_examined: 1
# Query_time: 0,022966 Lock_time: 0,000102 Rows_sent: 0 Rows_examined: 1
# Query_time: 0,117217 Lock_time: 0,000070 Rows_sent: 1 Rows_examined: 500000
# Query_time: 0,048257 Lock_time: 0,000089 Rows_sent: 0 Rows_examined: 0
# Query_time: 0,122213 Lock_time: 0,000068 Rows_sent: 1 Rows_examined: 500001
# Query_time: 0,033802 Lock_time: 0,000040 Rows_sent: 0 Rows_examined: 1
# Query_time: 0,022777 Lock_time: 0,000132 Rows_sent: 0 Rows_examined: 1
# Query_time: 0,138520 Lock_time: 0,000077 Rows_sent: 1 Rows_examined: 500000
# Query_time: 0,026862 Lock_time: 0,000091 Rows_sent: 0 Rows_examined: 0
# Query_time: 0,112981 Lock_time: 0,000069 Rows_sent: 1 Rows_examined: 500001
# Query_time: 0,051570 Lock_time: 0,000044 Rows_sent: 0 Rows_examined: 1
# Query_time: 0,022970 Lock_time: 0,000092 Rows_sent: 0 Rows_examined: 1
# Query_time: 0,114645 Lock_time: 0,000067 Rows_sent: 1 Rows_examined: 500000
# Query_time: 0,050807 Lock_time: 0,000122 Rows_sent: 0 Rows_examined: 0
# Query_time: 0,115831 Lock_time: 0,000068 Rows_sent: 1 Rows_examined: 500001
# Query_time: 0,040165 Lock_time: 0,000046 Rows_sent: 0 Rows_examined: 1
# Query_time: 0,022829 Lock_time: 0,000098 Rows_sent: 0 Rows_examined: 1
# Query_time: 0,129765 Lock_time: 0,000071 Rows_sent: 1 Rows_examined: 500000
# Query_time: 0,035642 Lock_time: 0,000087 Rows_sent: 0 Rows_examined: 0
# Query_time: 0,116264 Lock_time: 0,000067 Rows_sent: 1 Rows_examined: 500001
# Query_time: 0,039860 Lock_time: 0,000044 Rows_sent: 0 Rows_examined: 1
# Query_time: 0,022871 Lock_time: 0,000117 Rows_sent: 0 Rows_examined: 1
# Query_time: 0,127930 Lock_time: 0,000072 Rows_sent: 1 Rows_examine
all query with Rows_examined: 500000 (500001) related to x2_trigger_logs

Above you can see the 'x2_trigger_logs' table is currently full with 500,000 records (sized down from the X2CRM default of 1 million).

 

All of our X2CRM tables are using the MySQL InnoDB storage engine. We did find significant improvement would be gained if the 'x2_trigger_logs' table were converted to MyISAM.

 

See this resource as to why this query is particularly slow with InnoDB:

https://www.percona....-innodb-tables/

 

We have only tested the MyISAM table conversion in a test environment and are not sure if this is safe to do in production.

 

So, my two questions are:

 

1. Is it safe to change the 'x2_trigger_logs' table to MyISAM as a workaround until this is addressed in X2CRM?

 

2. Can you reproduce the issue above and let us know plans for a fix?

 

 

Thank you!

 


X2 Flow - Add tag from macro fails

07 August 2017 - 09:21 AM

I created an X2 Flow with the 'Edit Tags' action to add a a tag to a record. The flow fails when I execute the macro.

Here is the trigger log:

 

August 7, 2017, 10:09:16 AM

Trigger: Macro Executed (Success: View record: Redacted)
Edit Tags (Failure)
 

 

Here is the simple test flow:

{
  "version": "5.2",
  "idCounter": 2,
  "trigger": {
    "id": 1,
    "type": "MacroTrigger",
    "options": {
      "modelClass": {
        "value": "Contacts"
      }
    },
    "modelClass": "Contacts"
  },
  "items": [
    {
      "id": 2,
      "type": "X2FlowRecordTag",
      "options": {
        "action": {
          "value": "add"
        },
        "tags (optional)": {
          "value": "#test"
        }
      }
    }
  ],
  "flowName": "Test Tagging",
  "flowDesc": "Test adding a tag."
}

 

I'm attaching the X2 Flow exported file as well.

 


X2 Flow - Adding multiple tags not working properly

07 August 2017 - 09:17 AM

I have an X2Flow that includes an 'Edit Tags' action set to add 3 tags to a record. The tags are separated by commas, for example: #one,#two,#three

 

The expected result is that 3 separate tags are added to the record:

#one

#two

#three

 

However, the actual result is one merged tag being added:

#one#two#three

 

 


Tags missing in UI for X2Flows after 6.9 Update

03 August 2017 - 02:18 PM

I updated to version 6.9 yesterday and just noticed in the X2Flows that the Edit Tags action does not display the tags in the textfield anymore for previously saved flows. I verified the tags themselves do still exist by exporting the flow as a .json but they do not appear in the UI now.

 

This makes it particularly hard to work on existing flows without first exporting and reading the json so hopefully this bug can be escalated for a patch soon?