Forum Discussion

vacuesta's avatar
vacuesta
Helper I
6 years ago

mysql query has too much data

Hi,

 

Do any of you have any recommendations on how to run a mysql query with too much data? This is the query:

 

select hourly_if_util.collection_time, dev.roa_id,org.company,dev.device,dev.ip,tagname.tag_name,dev.active,hourly_if_util.if_id,hourly_if_util.did,tags.tag_id,hourly_if_util.avg_d_perc_in,hourly_if_util.avg_d_perc_out,hourly_if_util.avg_d_perc_in + hourly_if_util.avg_d_perc_out as avg_d_perc_inout,hourly_if_util.max_d_perc_in,hourly_if_util.max_d_perc_out,hourly_if_util.max_d_perc_in + hourly_if_util.max_d_perc_out as max_d_perc_inout,interface.if_id as iftbl_if_id,tags.tag_id,tagname.tag_name,interface.did,interface.roa_id,interface.ifIndex,interface.ifPhysAddress,interface.ifType,interface.ifSpeed,interface.ifHighSpeed,interface.ifDescr,interface.alias,interface.name,interface.ifOperStatus,interface.ifAdminStatus,interface.ifConnectorPresent,interface.ifLastChange
  from master_dev.device_interfaces interface
    left join master_dev.device_interface_tags_map tags ON (interface.if_id = tags.if_id)
    left join master_dev.device_interface_tags tagname ON (tags.tag_id = tagname.tag_id)
  left join data_ifutil.normalized_hourly hourly_if_util ON (hourly_if_util.if_id = interface.if_id)
  JOIN master_dev.legend_device dev ON (dev.id = interface.did)
  JOIN master_biz.organizations org ON (dev.roa_id = org.roa_id)
 
  where org.company IN ('company') AND  hourly_if_util.collection_time>='2019-08-01 00:00:00'

 

 

It runs the preview of the data fine; however, when it comes time to applying the changes onto the desktop report it runs up 20 millions rows  from the query then it says memory allocation failure or failure in general as the error.

 

Do you recommend a better way to query my MYSQL data using this query? Any advice.


Please let me know.
Thanks.

2 Replies

  • Do you require to analyze data at that level? If no then take data grouped at some other level.

     

    Check your RAM usage and try to free up more memory or increase virtual memory.

     

     

    • vacuesta's avatar
      vacuesta
      Helper I

      What do you recommend I group this data by?