Re: Query is taking too long i intermittent

2022-06-06 Thread Mayank Kandari
Thanks for the tip! I will update my process and monitor it. On Mon, Jun 6, 2022 at 7:41 PM Tom Lane wrote: > Justin Pryzby writes: > > On Mon, Jun 06, 2022 at 03:28:43PM +0530, Mayank Kandari wrote: > >> SELECT event_id FROM event WHERE (event_sec > time.seconds) OR > >> ((event_sec=time.seco

Re: Query is taking too long i intermittent

2022-06-06 Thread Tom Lane
Justin Pryzby writes: > On Mon, Jun 06, 2022 at 03:28:43PM +0530, Mayank Kandari wrote: >> SELECT event_id FROM event WHERE (event_sec > time.seconds) OR >> ((event_sec=time.seconds) AND (event_usec>=time.useconds) ORDER BY >> event_sec, event_usec LIMIT 1 > I think it'd be better if the column w

Re: Query is taking too long i intermittent

2022-06-06 Thread Justin Pryzby
On Mon, Jun 06, 2022 at 03:28:43PM +0530, Mayank Kandari wrote: > Thanks for including the link*. (*FYI, I find it to be kind of unfriendly to ask the same question in multiple forums, simultaneously - it's like cross-posting. The goal seems to

Query is taking too long i intermittent

2022-06-06 Thread Mayank Kandari
0 I am using libpq to connect the Postgres server in c++ code. Postgres server version is 12.10 My table schema is defined below Column| Type | Collation | Nullable | Default | Storage | Stats target | Description ---