MYSQL: How to speed up the query?

291
March 22, 2017, at 7:31 PM

How can I speed up this query?

SELECT 'form_registry_pages'.'id', 'form_registry_pages'.'number', 'form_registry'.'pretag'
FROM 'form_registry_pages', 'form_registry'
WHERE 'form_registry'.'id' = 'form_registry_pages'.'form_registry_id'
AND 'form_registry'.'start_date' != '0000-00-00' AND 'form_registry'.'finish_date' != '0000-00-00'
AND (
   (SELECT 'to_id'
   FROM 'form_registry_pages_pos'
   WHERE 'page_id' = 'form_registry_pages'.'id' AND 'to_type' = '1'
   ORDER BY 'time' DESC
   LIMIT 0,1) IN (80)
   OR
   (SELECT 'to_id'
   FROM 'form_registry_pages_pos'
   WHERE 'page_id' = 'form_registry_pages'.'id' AND 'to_type' = '2'
   ORDER BY 'time' DESC
   LIMIT 0,1) IN (6,41)
   )
   AND (SELECT COUNT(*)
   FROM 'form_registry_pages_assigns'
   WHERE 'page_id' = 'form_registry_pages'.'id') = 0;

It's a bit slow and I need to speed up a bit. What do you advice?

READ ALSO
Request.form returns value with comma

Request.form returns value with comma

When I run this code:

254
UPDATE meta_value for wp_usermeta with checking multiple meta_key and meta_value

UPDATE meta_value for wp_usermeta with checking multiple meta_key and meta_value

I have to UPDATE all the level IDs (_issuem_leaky_paywall_live_level_id) to X on wp_usermeta table

264
sum up amount of entries in a table in Ruby on Rails

sum up amount of entries in a table in Ruby on Rails

I've got a table that looks like this

265
Authentication using AngularJS and Spring Security

Authentication using AngularJS and Spring Security

I want to create a login page using AngularJS , Spring-Boot and Spring-security I follow this tutorial and every thing works fine

370