Search Postgresql Archives

Re: Apply LIMIT when computation is logically irrelevant

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

 



On Mon, Jul 6, 2020 at 5:37 AM Robins Tharakan <tharakan@xxxxxxxxx> wrote:
This need came up while reviewing generated SQL, where the need was to return true when
at least one of two lists had a row.

Generated SQL... yep. That will happen. Manual SQL may be more work, but often has significant reward.

If you can change how the SQL is generated, I would expect that EXISTS would likely be more performant in your case, even if you need to do UNION ALL between the two current queries that potentially return true.

[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