Complex SQL query with optional tables

Status
Not open for further replies.
[url=http:/civis/viewtopic.php?p=29366397#p29366397:2a4trr79 said:
Ravensroke[/url]":2a4trr79]
Edit: Response to all the SQL nazis above: "Premature optimization is the root of all evil"; an extra 1=1 statement isn't going the be the bottleneck that kills your app.
I've never seen the WHERE 1=1 thing before, but if your optimizer isn't smart enough to make a tautology into a no-op, you have bigger problems.
 
[url=http:/civis/viewtopic.php?p=29375669#p29375669:t281donr said:
Pont[/url]":t281donr]
an extra 1=1 statement isn't going the be the bottleneck that kills your app
I dunno. Mix MySQL and PHP in there and you never know what gotcha is going to jump up at you.
Haven't those people switched to Node and Mongo yet? :cool:

Speaking of Mongo, document-based DB's are a nice clean alternative to an ORM for some use cases (and will screw you over faster than any ORM if you misuse them).
 
Status
Not open for further replies.