Question regarding necessary queries.
Created 6 years ago by william

Hi! See attached image with my pages queries and the html it is using. I have a couple of questions:

Would it be possible not to have to query the user table if your page has no use for it?

My page is the default one, Why is the following ones necessary? Isnt default_pages enough?

select * from `pixney_pages_contact_pages` where `pixney_pages_contact_pages`.`id` in ('1') and `pixney_pages_contact_pages`.`deleted_at` is null
select * from `pixney_pages_cases_pages` where `pixney_pages_cases_pages`.`id` in ('1') and `pixney_pages_cases_pages`.`deleted_at` is null
select * from `pixney_pages_case_pages` where `pixney_pages_case_pages`.`id` in ('1') and `pixney_pages_case_pages`.`deleted_at` is null
select * from `pixney_pages_default_pages` where `pixney_pages_default_pages`.`id` in ('1') and `pixney_pages_default_pages`.`deleted_at` is null

*Why is this one necessary when we have already asked for in page type id 1 earlier together with the other types?**

select * from `pixney_pages_types` where `pixney_pages_types`.`id` in ('1') and `pixney_pages_types`.`deleted_at` is null order by `sort_order` asc

william  —  6 years ago

Applications and applications_domains are empty, what are they for and is that query necessary every time?

select * from `applications` left join `applications_domains` on `applications`.`id` = `applications_domains`.`application_id` where `applications`.`domain` = '' or `applications_domains`.`domain` = '' limit 1
ryanthompson  —  6 years ago

Well.. in general identical queries are only called once even if they are attempted multiple times. Those first queries might indicate needing some cleanup. The applications query I thought was cached.. Do you have DB_CACHE=false or anything in your .env?

william  —  6 years ago

I have DB_CACHE set to true in my env file.

ryanthompson  —  6 years ago

I checked this out last night and cached a couple more queries but this is just something that needs to be brought to my attention as to rectify it. The extra eyes on queries and other aspects will help with pointing out the somewhat obvious so I can cache / fix / change it 😊

Issue that one cause I do want to test a bit more with it. But that query is the pivotal point of the multi-site switch.

william  —  6 years ago

Yes, ill file it😄

For the record you got this one : select * frompixney_settings_settings``

ryanthompson  —  6 years ago

Yes I got that one and preferences.