SELECT 
  cscart_logs.*, 
  cscart_users.firstname, 
  cscart_users.lastname 
FROM 
  cscart_logs 
  LEFT JOIN cscart_users USING(user_id) 
WHERE 
  1 
  AND (
    cscart_logs.timestamp >= 1731468165 
    AND cscart_logs.timestamp <= 1731471765
  ) 
  AND cscart_logs.type = 'requests' 
  AND cscart_logs.action = 'shipping' 
ORDER BY 
  cscart_logs.timestamp desc, 
  cscart_logs.log_id desc

Query time 0.00065

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "25.01"
    },
    "ordering_operation": {
      "using_filesort": false,
      "nested_loop": [
        {
          "table": {
            "table_name": "cscart_logs",
            "access_type": "range",
            "possible_keys": [
              "type",
              "idx_timestamp"
            ],
            "key": "idx_timestamp",
            "used_key_parts": [
              "timestamp"
            ],
            "key_length": "4",
            "rows_examined_per_scan": 12,
            "rows_produced_per_join": 5,
            "filtered": "50.00",
            "index_condition": "((`webmarco`.`cscart_logs`.`timestamp` >= 1731468165) and (`webmarco`.`cscart_logs`.`timestamp` <= 1731471765))",
            "cost_info": {
              "read_cost": "16.61",
              "eval_cost": "1.20",
              "prefix_cost": "17.81",
              "data_read_per_join": "863"
            },
            "used_columns": [
              "log_id",
              "user_id",
              "timestamp",
              "type",
              "event_type",
              "action",
              "object",
              "content",
              "backtrace",
              "company_id"
            ],
            "attached_condition": "((`webmarco`.`cscart_logs`.`type` = 'requests') and (`webmarco`.`cscart_logs`.`action` = 'shipping'))"
          }
        },
        {
          "table": {
            "table_name": "cscart_users",
            "access_type": "eq_ref",
            "possible_keys": [
              "PRIMARY"
            ],
            "key": "PRIMARY",
            "used_key_parts": [
              "user_id"
            ],
            "key_length": "3",
            "ref": [
              "webmarco.cscart_logs.user_id"
            ],
            "rows_examined_per_scan": 1,
            "rows_produced_per_join": 5,
            "filtered": "100.00",
            "cost_info": {
              "read_cost": "6.00",
              "eval_cost": "1.20",
              "prefix_cost": "25.01",
              "data_read_per_join": "38K"
            },
            "used_columns": [
              "user_id",
              "firstname",
              "lastname"
            ]
          }
        }
      ]
    }
  }
}

Result

log_id user_id timestamp type event_type action object content backtrace company_id firstname lastname
1292924 0 1731471764 requests N shipping a:4:{s:3:"url";s:43:"https://wwwcie.ups.com:443/ups.app/xml/Rate";s:7:"request";s:1408:"'<?xml version="1.0"?><AccessRequest xml:lang="en-US"><AccessLicenseNumber></AccessLicenseNumber><UserId>2021021214131415</UserId><Password>C;&amp;w&lt;.72iX.csV6</Password></AccessRequest><?xml version="1.0"?><RatingServiceSelectionRequest xml:lang="en-US"><Request><SubVersion>2201</SubVersion><TransactionReference><CustomerContext>Rate Request</CustomerContext><XpciVersion>1.0</XpciVersion></TransactionReference><RequestAction>Rate</RequestAction></Request><PickupType><Code>01</Code></PickupType><Shipment><Service><Code>96</Code></Service><Shipper><Address><PostalCode>42335</PostalCode><CountryCode>GR</CountryCode></Address></Shipper><ShipTo><Address><StateProvinceCode></StateProvinceCode><PostalCode></PostalCode><CountryCode></CountryCode><ResidentialAddressIndicator></ResidentialAddressIndicator></Address></ShipTo><ShipFrom><Address><StateProvinceCode>GR-H</StateProvinceCode><PostalCode>42335</PostalCode><CountryCode>GR</CountryCode><ResidentialAddressIndicator></ResidentialAddressIndicator></Address></ShipFrom><NumOfPieces>1</NumOfPieces><Package><PackagingType><Code>01</Code></PackagingType><Dimensions><UnitOfMeasurement><Code>CM</Code></UnitOfMeasurement><Length>10</Length><Width>10</Width><Height>10</Height></Dimensions><PackageWeight><UnitOfMeasurement><Code>KGS</Code></UnitOfMeasurement><Weight>0.1</Weight></PackageWeight></Package></Shipment></RatingServiceSelectionRequest>'";s:8:"response";s:479:"<?xml version="1.0"?> <RatingServiceSelectionResponse><Response><TransactionReference><CustomerContext>Rate Request</CustomerContext><XpciVersion>1.0</XpciVersion></TransactionReference><ResponseStatusCode>0</ResponseStatusCode><ResponseStatusDescription>Failure</ResponseStatusDescription><Error><ErrorSeverity>Hard</ErrorSeverity><ErrorCode>250003</ErrorCode><ErrorDescription>Invalid Access License number</ErrorDescription></Error></Response></RatingServiceSelectionResponse>";s:8:"shipping";s:13:"upsdeprecated";} 0
1292922 0 1731471764 requests N shipping a:4:{s:3:"url";s:62:"https://xmlpi-ea.dhl.com/XMLShippingServlet?isUTF8Support=true";s:7:"request";s:2055:"'<?xml version="1.0" encoding="UTF-8" ?> <p:DCTRequest xmlns:p="http://www.dhl.com" xmlns:p1="http://www.dhl.com/datatypes" xmlns:p2="http://www.dhl.com/DCTRequestdatatypes" schemaVersion="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.dhl.com DCT-req.xsd " > <GetQuote> <Request> <ServiceHeader> <MessageTime>2024-11-13T05:22:45+01:00</MessageTime> <MessageReference>fe0db01abb657d7d655d93efcf9df8e0</MessageReference> <SiteID>v62_X3Bpbbforg</SiteID> <Password>UaHGw5zZdR</Password> </ServiceHeader> <MetaData> <SoftwareName>CS-Cart</SoftwareName> <SoftwareVersion>4.17.2.SP1</SoftwareVersion> </MetaData> </Request> <From> <CountryCode>GR</CountryCode> <Postalcode>42335</Postalcode> <City>Larisa</City> </From> <BkgDetails> <PaymentCountryCode>IT</PaymentCountryCode> <Date>2024-11-13</Date> <ReadyTime>PT05H22M</ReadyTime> <DimensionUnit>CM</DimensionUnit> <WeightUnit>KG</WeightUnit> <Pieces> <Piece> <PieceID>1</PieceID> <Height>0</Height> <Depth>0</Depth> <Width>0</Width> <Weight>0.1</Weight> </Piece> </Pieces> <PaymentAccountNumber>100083707</PaymentAccountNumber> <IsDutiable>Y</IsDutiable> <QtdShp> <GlobalProductCode>P</GlobalProductCode> </QtdShp> </BkgDetails> <To> <CountryCode></CountryCode> <Postalcode></Postalcode> <City></City> </To> <Dutiable> <DeclaredCurrency>EUR</DeclaredCurrency> <DeclaredValue>70</DeclaredValue> </Dutiable> </GetQuote> </p:DCTRequest>'";s:8:"response";s:920:"<?xml version="1.0" encoding="UTF-8"?><res:ErrorResponse xmlns:res='http://www.dhl.com' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation= 'http://www.dhl.com err-res.xsd'> <Response> <ServiceHeader> <MessageTime>2024-11-13T04:22:45.227+00:00</MessageTime> <MessageReference>fe0db01abb657d7d655d93efcf9df8e0</MessageReference> <SiteID>v62_X3Bpbbforg</SiteID> </ServiceHeader> <Status> <ActionStatus>Error</ActionStatus> <Condition> <ConditionCode>111</ConditionCode> <ConditionData>Error in parsing request XML:Error: cvc-length-valid: Value '' with length = '0' is not facet-valid with respect to length '2' for type '#AnonType_CountryCodeDCTTo'. at line 43, column 27</ConditionData> </Condition> </Status> </Response></res:ErrorResponse><!-- ServiceInvocationId:20241113042245_108e_401a31e4-45b2-49a2-805b-fccf86e12dba -->";s:8:"shipping";s:3:"dhl";} 0
1292920 0 1731471764 requests N shipping a:4:{s:3:"url";s:62:"https://xmlpi-ea.dhl.com/XMLShippingServlet?isUTF8Support=true";s:7:"request";s:1918:"'<?xml version="1.0" encoding="UTF-8" ?> <p:DCTRequest xmlns:p="http://www.dhl.com" xmlns:p1="http://www.dhl.com/datatypes" xmlns:p2="http://www.dhl.com/DCTRequestdatatypes" schemaVersion="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.dhl.com DCT-req.xsd " > <GetQuote> <Request> <ServiceHeader> <MessageTime>2024-11-13T05:22:45+01:00</MessageTime> <MessageReference>60ac131f6c50a4a14400c977f85dc994</MessageReference> <SiteID>v62_X3Bpbbforg</SiteID> <Password>UaHGw5zZdR</Password> </ServiceHeader> <MetaData> <SoftwareName>CS-Cart</SoftwareName> <SoftwareVersion>4.17.2.SP1</SoftwareVersion> </MetaData> </Request> <From> <CountryCode>GR</CountryCode> <Postalcode>42335</Postalcode> <City>Larisa</City> </From> <BkgDetails> <PaymentCountryCode>IT</PaymentCountryCode> <Date>2024-11-13</Date> <ReadyTime>PT05H22M</ReadyTime> <DimensionUnit>IN</DimensionUnit> <WeightUnit>LB</WeightUnit> <Pieces> <Piece> <PieceID>1</PieceID> <Height>0</Height> <Depth>0</Depth> <Width>0</Width> <Weight>0.2</Weight> </Piece> </Pieces> <PaymentAccountNumber>100083707</PaymentAccountNumber> <IsDutiable>N</IsDutiable> <QtdShp> <GlobalProductCode>N</GlobalProductCode> </QtdShp> </BkgDetails> <To> <CountryCode></CountryCode> <Postalcode></Postalcode> <City></City> </To> </GetQuote> </p:DCTRequest>'";s:8:"response";s:920:"<?xml version="1.0" encoding="UTF-8"?><res:ErrorResponse xmlns:res='http://www.dhl.com' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation= 'http://www.dhl.com err-res.xsd'> <Response> <ServiceHeader> <MessageTime>2024-11-13T04:22:45.240+00:00</MessageTime> <MessageReference>60ac131f6c50a4a14400c977f85dc994</MessageReference> <SiteID>v62_X3Bpbbforg</SiteID> </ServiceHeader> <Status> <ActionStatus>Error</ActionStatus> <Condition> <ConditionCode>111</ConditionCode> <ConditionData>Error in parsing request XML:Error: cvc-length-valid: Value '' with length = '0' is not facet-valid with respect to length '2' for type '#AnonType_CountryCodeDCTTo'. at line 43, column 27</ConditionData> </Condition> </Status> </Response></res:ErrorResponse><!-- ServiceInvocationId:20241113042245_108e_048b217b-2e31-405f-8e54-b7e889ed5082 -->";s:8:"shipping";s:3:"dhl";} 0
1292911 0 1731471638 requests N shipping a:4:{s:3:"url";s:43:"https://wwwcie.ups.com:443/ups.app/xml/Rate";s:7:"request";s:1408:"'<?xml version="1.0"?><AccessRequest xml:lang="en-US"><AccessLicenseNumber></AccessLicenseNumber><UserId>2021021214131415</UserId><Password>C;&amp;w&lt;.72iX.csV6</Password></AccessRequest><?xml version="1.0"?><RatingServiceSelectionRequest xml:lang="en-US"><Request><SubVersion>2201</SubVersion><TransactionReference><CustomerContext>Rate Request</CustomerContext><XpciVersion>1.0</XpciVersion></TransactionReference><RequestAction>Rate</RequestAction></Request><PickupType><Code>01</Code></PickupType><Shipment><Service><Code>96</Code></Service><Shipper><Address><PostalCode>42335</PostalCode><CountryCode>GR</CountryCode></Address></Shipper><ShipTo><Address><StateProvinceCode></StateProvinceCode><PostalCode></PostalCode><CountryCode></CountryCode><ResidentialAddressIndicator></ResidentialAddressIndicator></Address></ShipTo><ShipFrom><Address><StateProvinceCode>GR-H</StateProvinceCode><PostalCode>42335</PostalCode><CountryCode>GR</CountryCode><ResidentialAddressIndicator></ResidentialAddressIndicator></Address></ShipFrom><NumOfPieces>1</NumOfPieces><Package><PackagingType><Code>01</Code></PackagingType><Dimensions><UnitOfMeasurement><Code>CM</Code></UnitOfMeasurement><Length>10</Length><Width>10</Width><Height>10</Height></Dimensions><PackageWeight><UnitOfMeasurement><Code>KGS</Code></UnitOfMeasurement><Weight>0.1</Weight></PackageWeight></Package></Shipment></RatingServiceSelectionRequest>'";s:8:"response";s:479:"<?xml version="1.0"?> <RatingServiceSelectionResponse><Response><TransactionReference><CustomerContext>Rate Request</CustomerContext><XpciVersion>1.0</XpciVersion></TransactionReference><ResponseStatusCode>0</ResponseStatusCode><ResponseStatusDescription>Failure</ResponseStatusDescription><Error><ErrorSeverity>Hard</ErrorSeverity><ErrorCode>250003</ErrorCode><ErrorDescription>Invalid Access License number</ErrorDescription></Error></Response></RatingServiceSelectionResponse>";s:8:"shipping";s:13:"upsdeprecated";} 0
1292909 0 1731471638 requests N shipping a:4:{s:3:"url";s:62:"https://xmlpi-ea.dhl.com/XMLShippingServlet?isUTF8Support=true";s:7:"request";s:2055:"'<?xml version="1.0" encoding="UTF-8" ?> <p:DCTRequest xmlns:p="http://www.dhl.com" xmlns:p1="http://www.dhl.com/datatypes" xmlns:p2="http://www.dhl.com/DCTRequestdatatypes" schemaVersion="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.dhl.com DCT-req.xsd " > <GetQuote> <Request> <ServiceHeader> <MessageTime>2024-11-13T05:20:38+01:00</MessageTime> <MessageReference>b5cba5190cd432bccf07fcb45391ab33</MessageReference> <SiteID>v62_X3Bpbbforg</SiteID> <Password>UaHGw5zZdR</Password> </ServiceHeader> <MetaData> <SoftwareName>CS-Cart</SoftwareName> <SoftwareVersion>4.17.2.SP1</SoftwareVersion> </MetaData> </Request> <From> <CountryCode>GR</CountryCode> <Postalcode>42335</Postalcode> <City>Larisa</City> </From> <BkgDetails> <PaymentCountryCode>IT</PaymentCountryCode> <Date>2024-11-13</Date> <ReadyTime>PT05H20M</ReadyTime> <DimensionUnit>CM</DimensionUnit> <WeightUnit>KG</WeightUnit> <Pieces> <Piece> <PieceID>1</PieceID> <Height>0</Height> <Depth>0</Depth> <Width>0</Width> <Weight>0.1</Weight> </Piece> </Pieces> <PaymentAccountNumber>100083707</PaymentAccountNumber> <IsDutiable>Y</IsDutiable> <QtdShp> <GlobalProductCode>P</GlobalProductCode> </QtdShp> </BkgDetails> <To> <CountryCode></CountryCode> <Postalcode></Postalcode> <City></City> </To> <Dutiable> <DeclaredCurrency>EUR</DeclaredCurrency> <DeclaredValue>35</DeclaredValue> </Dutiable> </GetQuote> </p:DCTRequest>'";s:8:"response";s:920:"<?xml version="1.0" encoding="UTF-8"?><res:ErrorResponse xmlns:res='http://www.dhl.com' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation= 'http://www.dhl.com err-res.xsd'> <Response> <ServiceHeader> <MessageTime>2024-11-13T04:20:39.077+00:00</MessageTime> <MessageReference>b5cba5190cd432bccf07fcb45391ab33</MessageReference> <SiteID>v62_X3Bpbbforg</SiteID> </ServiceHeader> <Status> <ActionStatus>Error</ActionStatus> <Condition> <ConditionCode>111</ConditionCode> <ConditionData>Error in parsing request XML:Error: cvc-length-valid: Value '' with length = '0' is not facet-valid with respect to length '2' for type '#AnonType_CountryCodeDCTTo'. at line 43, column 27</ConditionData> </Condition> </Status> </Response></res:ErrorResponse><!-- ServiceInvocationId:20241113042039_108e_8a1c4932-3723-4fe8-b5ec-32319b662795 -->";s:8:"shipping";s:3:"dhl";} 0
1292907 0 1731471638 requests N shipping a:4:{s:3:"url";s:62:"https://xmlpi-ea.dhl.com/XMLShippingServlet?isUTF8Support=true";s:7:"request";s:1918:"'<?xml version="1.0" encoding="UTF-8" ?> <p:DCTRequest xmlns:p="http://www.dhl.com" xmlns:p1="http://www.dhl.com/datatypes" xmlns:p2="http://www.dhl.com/DCTRequestdatatypes" schemaVersion="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.dhl.com DCT-req.xsd " > <GetQuote> <Request> <ServiceHeader> <MessageTime>2024-11-13T05:20:38+01:00</MessageTime> <MessageReference>58fd4d56aa3b7f639e633e10198129f2</MessageReference> <SiteID>v62_X3Bpbbforg</SiteID> <Password>UaHGw5zZdR</Password> </ServiceHeader> <MetaData> <SoftwareName>CS-Cart</SoftwareName> <SoftwareVersion>4.17.2.SP1</SoftwareVersion> </MetaData> </Request> <From> <CountryCode>GR</CountryCode> <Postalcode>42335</Postalcode> <City>Larisa</City> </From> <BkgDetails> <PaymentCountryCode>IT</PaymentCountryCode> <Date>2024-11-13</Date> <ReadyTime>PT05H20M</ReadyTime> <DimensionUnit>IN</DimensionUnit> <WeightUnit>LB</WeightUnit> <Pieces> <Piece> <PieceID>1</PieceID> <Height>0</Height> <Depth>0</Depth> <Width>0</Width> <Weight>0.2</Weight> </Piece> </Pieces> <PaymentAccountNumber>100083707</PaymentAccountNumber> <IsDutiable>N</IsDutiable> <QtdShp> <GlobalProductCode>N</GlobalProductCode> </QtdShp> </BkgDetails> <To> <CountryCode></CountryCode> <Postalcode></Postalcode> <City></City> </To> </GetQuote> </p:DCTRequest>'";s:8:"response";s:920:"<?xml version="1.0" encoding="UTF-8"?><res:ErrorResponse xmlns:res='http://www.dhl.com' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation= 'http://www.dhl.com err-res.xsd'> <Response> <ServiceHeader> <MessageTime>2024-11-13T04:20:39.069+00:00</MessageTime> <MessageReference>58fd4d56aa3b7f639e633e10198129f2</MessageReference> <SiteID>v62_X3Bpbbforg</SiteID> </ServiceHeader> <Status> <ActionStatus>Error</ActionStatus> <Condition> <ConditionCode>111</ConditionCode> <ConditionData>Error in parsing request XML:Error: cvc-length-valid: Value '' with length = '0' is not facet-valid with respect to length '2' for type '#AnonType_CountryCodeDCTTo'. at line 43, column 27</ConditionData> </Condition> </Status> </Response></res:ErrorResponse><!-- ServiceInvocationId:20241113042039_108e_cf0d8ddf-1010-4ed1-8e33-602e68cc912d -->";s:8:"shipping";s:3:"dhl";} 0