Array
(
    [0] => Warning
    [1] => Undefined array key "language"
    [2] => /home/whmcsdev/public_repo/wbteampro.major-release/installation/modules/addons/wbteampro/initialize.php
    [3] => 282
)
Array
(
    [0] => Warning
    [1] => Undefined property: stdClass::$state
    [2] => /home/whmcsdev/public_repo/wbavatax.master/installation/modules/addons/wbavatax/hooks.php
    [3] => 942
)
Array
(
    [0] => Deprecated
    [1] => htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated
    [2] => /home/whmcsdev/public_repo/wbavatax.master/installation/modules/addons/wbavatax/hooks.php
    [3] => 279
)
Faster SQL Joins - Knowledgebase - WHMCS Dev
Dev License: This installation of WHMCS is running under a Development License and is not authorized to be used for production use. Please report any cases of abuse to abuse@whmcs.com

Faster SQL Joins Print

  • 3

Improve the speed of a JOIN by arranging your comparisons properly.

Instead of placing your comparisons for a join with the primary query, as in:

SELECT foo.id
FROM tblfoo AS foo
JOIN tblbar AS bar ON bar.fooId = foo.id
WHERE foo.type = 'good'
  AND bar.style = 'flat'

Move your joined comparisons directly to the JOIN command, as in:

SELECT foo.id
FROM tblfoo AS foo
JOIN tblbar AS bar ON bar.fooId = foo.id AND bar.style = 'flat'
WHERE foo.type = 'good'
  AND bar.id IS NOT NULL

This reduces the size of your temporary join dataset before your primary query is executed.

Was this answer helpful?

« Back

Powered by WHMCompleteSolution