artfulrobot Posted February 7 Posted February 7 I have a selector like this: "template=job, job_id!=1|2|3|..." The purpose is to find all job pages except for those given in the OR list. I'd expect SQL like this: SELECT pages.id,pages.templates_id FROM `pages` LEFT JOIN field_job_id ON pages_id=pages.id WHERE (pages.templates_id=123) AND field_job_id NOT IN (1,2,3,4,...); However the PW query builder seems to generate something far more complex, including adding a JOIN for every id!=1|2|3|... value - this tips over Mysql's joins limit (61 in MariaDB at least) and causes a crash. I've had to work around this by instead of using selectors, loop every job page in PHP and test it's job_id field against the set I want to exclude, which is really inefficient. Is there a way to make the selector → SQL more efficient/not crashy? 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now