Re: EXISTS by itself vs SELECT EXISTS much slower in query.

2021-11-09 Thread Jimmy A
I see, I never knew that. Indeed there is a hashed subplan for the EXISTS by itself. So that explains it. Thanks Tom. On Mon, Nov 8, 2021 at 12:35 PM Tom Lane wrote: > Jimmy A writes: > > I have two equivalent queries, one with an EXISTS clause by itself and > one > > wr

EXISTS by itself vs SELECT EXISTS much slower in query.

2021-11-08 Thread Jimmy A
A description of what you are trying to achieve and what results you expect.: I have two equivalent queries, one with an EXISTS clause by itself and one wrapped in a (SELECT EXISTS) and the "naked" exists is much slower. I would expect both to be the same speed / have same execution plan. -- slow

Why the sql is not executed in parallel mode

2018-09-18 Thread jimmy
Why the sql is not executed in parallel mode, does the sql has some problem? with sql1 as (select a.* from snaps a where a.f_date between to_date('2018-03-05', '-MM-dd') and to_date('2018-03-11', '-MM-dd') ), sql2 as (select '1' as pId, PM_TO as pValue, type_code as typeCode,

RE: Query is slow when run for first time; subsequent execution is fast

2018-09-04 Thread jimmy
On windows, how to put an entry in my db startup script to run this query (pg_prewarm) immediately after startng the server, and let the query warm the cache itself. After starting the server, I want to know what is the server, and it is the database I restarted or windows system? Thank you.