Search Postgresql Archives

Re: Tricking the optimizer

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

 



We've tried to use "... WHERE coalesce(...)::bool;" on a test query:

Before:
->  Seq Scan on public.sys_user sys_user_1  (cost=0.00..27140.46 rows=1 width=16) (actual time=0.105..38.627 rows=3289 loops=1)       Filter: (((SubPlan 7) = 0) AND ((SubPlan 8) = 0) AND ((SubPlan 9) = 0))

After:
->  Seq Scan on public.sys_user sys_user_1  (cost=0.00..27140.46 rows=1790 width=16) (actual time=0.136..28.413 rows=3289 loops=1)       Filter: COALESCE((((SubPlan 7) = 0) AND ((SubPlan 8) = 0) AND ((SubPlan 9) = 0)))

The estimate got closer to the actual number of rows.

Regards,
Vitaliy




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux