Skip to content

Instantly share code, notes, and snippets.

@mcsee
Last active August 28, 2023 01:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcsee/22deb44d4e95b4a3ca8ce9ba18d0f908 to your computer and use it in GitHub Desktop.
Save mcsee/22deb44d4e95b4a3ca8ce9ba18d0f908 to your computer and use it in GitHub Desktop.
<?
final class DatabaseQueryOptimizer {
public function selectWithCriteria($tableName, $criteria) {
// Make some optimizations manipulating criteria
}
private function sqlParserOptimization(SQLSentence $sqlSentence)
: SQLSentence {
// Parse the SQL converting it to a string
// and then working with their nodes as strings and lots of regex
// This was a very costly operation overcoming real SQL benefits.
// But since you made too much work you decide to keep the code.
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment