Re: Slow Query

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In the 'not exists' cluster, you do not have to search table "Vacancy as v" again.
I think it would be faster to use the outer Vacancy table as below.
In your case, that do the same work.

NOT EXISTS (
        SELECT 1
        FROM "CategoryOption_TableRow" "ct126" 
        WHERE "Vacancy"."Template"
          AND "ct126"."CategoryOptionID" IN (34024,35254,35255,35256)
          AND "ct126"."Category_TableID" = 126
          AND "ct126"."RowID" = "Vacancy"."ID"
          )

[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux