Home › Forums › Calendar Products › Events Calendar PRO › Queries are locking database
- This topic has 2 replies, 2 voices, and was last updated 8 years, 11 months ago by Nico.
-
AuthorPosts
-
June 8, 2015 at 11:00 am #967893brainpopParticipant
Here is a sample of a query that is locking our db. This is the standard month view.
It has THREE inner joins. Is that normal?
SELECT wp_posts.* FROM wp_posts INNER JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.post_id ) INNER JOIN wp_postmeta AS mt1 ON ( wp_posts.ID = mt1.post_id ) INNER JOIN wp_postmeta AS mt2 ON ( wp_posts.ID = mt2.post_id ) INNER JOIN wp_postmeta AS mt3 ON ( wp_posts.ID = mt3.post_id ) WHERE 1=1 AND wp_posts.post_type = 'tribe_events' AND ((wp_posts.post_status = 'publish')) AND ( wp_postmeta.meta_key = '_EventStartDate' AND ( mt1.meta_key = '_EventStartDate' AND ( mt2.meta_key = '_EventStartDate' AND CAST(mt2.meta_value AS DATE) >= '2015-05-01 00:00:00' ) AND ( mt3.meta_key = '_EventEndDate' AND CAST(mt3.meta_value AS DATE) <= '2015-05-31 24:00:00' ) ) ) GROUP BY wp_posts.ID ORDER BY wp_postmeta.meta_value ASC
What can we do to optimize?
June 9, 2015 at 10:11 am #968202NicoMemberHi brainpop,
Thanks for reaching out on this.
Actually it’s normal to see some multiple JOINs in our product queries. I’m sorry there’s no work around for this right now 🙁
I pinged the dev team about this and it’s something that will probably be refactored in the future (maybe adding a table), but I’m sorry to say that will not happen in the short-term. You are welcome to suggest this a feature for future releases at our UserVoice page, that way it can up-voted by the community.
Sorry I can’t be of much help with this,
Best,
NicoJune 24, 2015 at 7:53 am #972597NicoMemberHey brainpop,
Since there hasn’t been any activity on this thread for over 2 weeks I’m now closing it. Feel free to start a new thread if you have further issues.
Thanks,
Nico -
AuthorPosts
- The topic ‘Queries are locking database’ is closed to new replies.