Home › Forums › Calendar Products › Events Calendar PRO › Error in Queries with The Events Calendar Pro
- This topic has 2 replies, 3 voices, and was last updated 10 years, 2 months ago by
Support Droid.
-
AuthorPosts
-
January 14, 2016 at 2:55 am #1055784
Ediciones y Recursos Ocio-Culturales
ParticipantHi.
We’re getting this kind of errors:
[13-Jan-2016 20:59:59 UTC] Error Server shutdown in progress de la base de datos de WordPress para la consulta SELECT SQL_CALC_FOUND_ROWS DISTINCT wp_posts.*, MIN(wp_postmeta.meta_value) as EventStartDate, MIN(tribe_event_end_date.meta_value) as EventEndDate FROM wp_posts INNER JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) INNER JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.post_id ) LEFT JOIN wp_postmeta as tribe_event_end_date ON ( wp_posts.ID = tribe_event_end_date.post_id AND tribe_event_end_date.meta_key = '_EventEndDate' ) WHERE 1=1 AND ( wp_term_relationships.term_taxonomy_id IN (16,19) OR wp_term_relationships.term_taxonomy_id IN (1887) ) AND ( wp_postmeta.meta_key = '_EventStartDate' ) AND wp_posts.post_type = 'tribe_events' AND ((wp_posts.post_status = 'publish')) AND ((wp_postmeta.meta_value >= '2016-01-13 21:59:59' AND wp_postmeta.meta_value <= '2016-02-01 04:59:59') OR (tribe_event_end_date.meta_value >= '2016-01-13 21:59:59' AND wp_postmeta.meta_value <= '2016-02-01 04:59:59' ) OR (wp_postmeta.meta_value < '2016-01-13 21:59:59' AND tribe_event_end_date.meta_value >= '2016-02-01 04:59:59' )) GROUP BY wp_posts.ID ORDER BY EventStartDate ASC, wp_posts.post_date ASC LIMIT 0, 4 realizada por require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/Nexus/page-eventos.php'), get_sidebar, locate_template, load_template, require_once('/themes/Nexus/sidebar.php'), dynamic_sidebar, call_user_func_array, WP_Widget->display_callback, Tribe__Events__Pro__Mini_Calendar_Widget->widget, Tribe__Events__Pro__Mini_Calendar->do_calendar, tribe_get_template_part, include('/plugins/events-calendar-pro/src/views/pro/widgets/mini-calendar-widget.php'), tribe_get_template_part, do_action('tribe_before_get_template_part'), call_user_func_array, Tribe__Events__Pro__Mini_Calendar->setup_list, Tribe__Events__Query::getEvents, WP_Query->__construct, WP_Query->query, WP_Query->get_posts, W3_Db->query, W3_DbCache->query, W3_DbCallUnderlying->query, W3_Db->query, W3_DbProcessor->query, W3_Db->default_query [13-Jan-2016 20:59:59 UTC] Error Lost connection to MySQL server during query de la base de datos de WordPress para la consulta (SELECT @pid := sp.id AS pid, 0 AS aid, sp.name, sp.patch_source AS code_mode, @code_before := sp.code_before AS code_before, @code_after := sp.code_after AS code_after, @ad_size := IF(sp.place_size = "custom", CONCAT(CAST(sp.place_custom_width AS CHAR), "x", CAST(sp.place_custom_height AS CHAR)), sp.place_size) AS ad_size, sp.patch_code AS ad_code, sp.patch_img AS ad_img, "" AS ad_alt, 0 AS ad_no, sp.patch_link AS ad_target, 0 AS ad_swf, "" AS ad_swf_flashvars, "" AS ad_swf_params, "" AS ad_swf_attributes, "" AS ad_swf_fallback, sp.patch_adserver AS ad_adserver, sp.patch_dfp AS ad_dfp, 0 AS count_clicks, 0 AS code_type, IF((sp.patch_source = 1 AND sp.patch_adserver) OR sp.patch_source = 2, -1, 1) AS ad_cycle, @aca := IFNULL((SELECT AVG(sa.ad_weight_hits*10/(sa.ad_weight*1000)) FROM wp_sam_ads sa WHERE sa.pid = @pid AND sa.trash IS NOT TRUE AND (IF(sa.ad_users = 0, TRUE, (sa.ad_users_unreg = 1))) AND ((sa.view_type = 1) OR (sa.view_type = 0 AND (sa.view_pages+0 & 10)) OR (sa.view_type = 2 AND FIND_IN_SET(210439, sa.view_id))) AND (sa.ad_cats = 0) AND (sa.ad_authors = 0) AND IF(sa.x_id, NOT FIND_IN_SET(210439, sa.x_view_id), TRUE) AND IF(sa.ad_schedule, CURDATE() BETWEEN sa.ad_start_date AND sa.ad_end_date, TRUE) AND IF(sa.limit_hits, sa.hits_limit > (SELECT IFNULL(COUNT(*), 0) FROM wp_sam_stats ss WHERE ss.id = sa.id AND ss.event_type = 0), TRUE) AND IF(sa.limit_clicks, sa.clicks_limit > (SELECT IFNULL(COUNT(*), 0) FROM wp_sam_stats ss WHERE ss.id = sa.id AND ss.event_type = 1), TRUE) AND (sa.ad_weight > 0)), 0) AS aca FROM wp_sam_places sp WHERE sp.id = 4 AND sp.trash IS FALSE) UNION (SELECT sa.pid, sa.id AS aid, sa.name, sa.code_mode, @code_before AS code_before, @code_after AS code_after, @ad_size AS ad_size, sa.ad_code, sa.ad_img, sa.ad_alt, sa.ad_no, sa.ad_target, sa.ad_swf, sa.ad_swf_flashvars, sa.ad_swf_params, sa.ad_swf_attributes, sa.ad_swf_fallback, 0 AS ad_adserver, 0 AS ad_dfp, sa.count_clicks, sa.code_type, IF(sa.ad_weight, (sa.ad_weight_hits*10/(sa.ad_weight*1000)), 0) AS ad_cycle, @aca AS aca FROM wp_sam_ads sa WHERE sa.pid = @pid AND sa.trash IS FALSE AND (IF(sa.ad_users = 0, TRUE, (sa.ad_users_unreg = 1))) AND ((sa.view_type = 1) OR (sa.view_type = 0 AND (sa.view_pages+0 & 10)) OR (sa.view_type = 2 AND FIND_IN_SET(210439, sa.view_id))) AND (sa.ad_cats = 0) AND (sa.ad_authors = 0) AND IF(sa.x_id, NOT FIND_IN_SET(210439, sa.x_view_id), TRUE) AND IF(sa.ad_schedule, CURDATE() BETWEEN sa.ad_start_date AND sa.ad_end_date, TRUE) AND IF(sa.limit_hits, sa.hits_limit > (SELECT IFNULL(COUNT(*), 0) FROM wp_sam_stats ss WHERE ss.id = sa.id AND ss.event_type = 0), TRUE) AND IF(sa.limit_clicks, sa.clicks_limit > (SELECT IFNULL(COUNT(*), 0) FROM wp_sam_stats ss WHERE ss.id = sa.id AND ss.event_type = 1), TRUE) AND IF(sa.ad_weight > 0, (sa.ad_weight_hits*10/(sa.ad_weight*1000)) < 1, FALSE)) ORDER BY ad_cycle LIMIT 1; realizada por require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/Nexus/page-eventos.php'), get_template_part, locate_template, load_template, require('/themes/Nexus/includes/footer-banner.php'), drawAdsPlace, SimpleAdsManager->buildAd, SamAdPlace->__construct, SamAdPlace->buildAd, W3_Db->query, W3_DbCache->query, W3_DbCallUnderlying->query, W3_Db->query, W3_DbProcessor->query, W3_Db->default_queryThe custom fields we’re using with the venues post type are these:
if(function_exists("register_field_group")) { register_field_group(array ( 'id' => 'acf_lugares_extra', 'title' => 'Lugares_extra', 'fields' => array ( array ( 'key' => 'field_5565754b96722', 'label' => 'Precio medio', 'name' => 'precio_medio', 'type' => 'select', 'choices' => array ( 'menos de 15€' => 'menos de 15€', 'de 16€ a 24€' => 'de 16€ a 24€', 'de 25€ a 39€' => 'de 25€ a 39€', 'más de 40€' => 'más de 40€', 'consultar tarifas' => 'consultar tarifas', ), 'default_value' => '', 'allow_null' => 0, 'multiple' => 0, ), array ( 'key' => 'field_55dec9555b652', 'label' => 'Cliente', 'name' => 'cliente', 'type' => 'true_false', 'message' => '', 'default_value' => 0, ), array ( 'key' => 'field_55dec9745b653', 'label' => 'Destacado', 'name' => 'destacado', 'type' => 'true_false', 'message' => '', 'default_value' => 0, ), array ( 'key' => 'field_55dec9835b654', 'label' => 'Observaciones', 'name' => 'observaciones', 'type' => 'wysiwyg', 'default_value' => '', 'toolbar' => 'full', 'media_upload' => 'yes', ), array ( 'key' => 'field_55dec9945b655', 'label' => 'Menú', 'name' => 'menu', 'type' => 'wysiwyg', 'default_value' => '', 'toolbar' => 'full', 'media_upload' => 'yes', ), array ( 'key' => 'field_55dec9ad5b656', 'label' => 'Coordenadas', 'name' => 'coordenadas', 'type' => 'text', 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'formatting' => 'html', 'maxlength' => '', ), array ( 'key' => 'field_55e5789ddbc15', 'label' => 'Etiquetas', 'name' => 'etiquetas', 'type' => 'text', 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'formatting' => 'html', 'maxlength' => '', ), ), 'location' => array ( array ( array ( 'param' => 'post_type', 'operator' => '==', 'value' => 'tribe_venue', 'order_no' => 0, 'group_no' => 0, ), ), ), 'options' => array ( 'position' => 'normal', 'layout' => 'default', 'hide_on_screen' => array ( ), ), 'menu_order' => 3, )); }The custom fields we’re using with the events are these:
if(function_exists("register_field_group")) { register_field_group(array ( 'id' => 'acf_eventos_extra', 'title' => 'Eventos_extra', 'fields' => array ( array ( 'key' => 'field_55df08089a3b8', 'label' => 'link entradas', 'name' => 'link_entradas', 'type' => 'text', 'default_value' => '', 'placeholder' => '', 'prepend' => '', 'append' => '', 'formatting' => 'html', 'maxlength' => '', ), ), 'location' => array ( array ( array ( 'param' => 'post_type', 'operator' => '==', 'value' => 'tribe_events', 'order_no' => 0, 'group_no' => 0, ), ), ), 'options' => array ( 'position' => 'normal', 'layout' => 'no_box', 'hide_on_screen' => array ( ), ), 'menu_order' => 0, )); }And these custom taxonomies for venues and events:
add_action( 'init', 'cptui_register_my_taxes' ); function cptui_register_my_taxes() { $labels = array( "name" => "Zonas", "label" => "Zonas", ); $args = array( "labels" => $labels, "hierarchical" => true, "label" => "Zonas", "show_ui" => true, "query_var" => true, "rewrite" => array( 'slug' => 'zonas', 'with_front' => true ), "show_admin_column" => false, ); register_taxonomy( "zonas", array( "tribe_events", "tribe_venue" ), $args ); $labels = array( "name" => "Tipos", "label" => "Tipos", ); $args = array( "labels" => $labels, "hierarchical" => true, "label" => "Tipos", "show_ui" => true, "query_var" => true, "rewrite" => array( 'slug' => 'tipos', 'with_front' => true ), "show_admin_column" => false, ); register_taxonomy( "tipos", array( "tribe_events", "tribe_venue" ), $args ); // End cptui_register_my_taxes }We’ve have followed all your recomendations on performance: https://theeventscalendar.com/the-events-calendar-performance-considerations/ and even more: https://theeventscalendar.com/support/forums/topic/events-calendar-pro-and-caching/
The problem with performance (as seen on https://theeventscalendar.com/support/forums/topic/sutainable-growing-of-the-events-calendar-plugin/) keeps on the WP admin every time we edit or add an event o venue. It’s quite slow.
We have a power server and everything opmitimized and we’re still having low performance. Our concern is about the expected growing of the web. The past events will be deleted, but the venues will keep growing.
Can you tell us how to optimize the queries or any other way to improve performance after following the recomendations?
Do you recommend another way to add the custom fields and taxonomies?Thanks.
January 14, 2016 at 8:01 am #1056046Barry
MemberHi!
I’m sorry to hear you’ve been experiencing difficulties.
Looking at the initial block of errors you shared, the problem doesn’t seem to be restricted to queries generated by our own plugins – so it’s possible there are more general issues that need to be solved.
Caching is one of the best ways to improve performance and there are lots of different forms and places that caching can be applied, ranging from the month view caching option we provide in the Events → Settings → Display admin screen through to page, object and query caching.
Exploring those would definitely be worthwhile.
Do you recommend another way to add the custom fields and taxonomies?
What you are doing looks fine, but really custom development isn’t something we can provide a large amount of support for here in the forums.
February 18, 2016 at 8:34 am #1076771Support Droid
KeymasterThis topic has not been active for quite some time and will now be closed.
If you still need assistance please simply open a new topic (linking to this one if necessary)
and one of the team will be only too happy to help. -
AuthorPosts
- The topic ‘Error in Queries with The Events Calendar Pro’ is closed to new replies.
