public inbox for [email protected]
help / color / mirror / Atom feedFrom: Francisco Olarte <[email protected]>
To: [email protected] <[email protected]>
Cc: Postgresql General Group <[email protected]>
Subject: Re: Re. Select with where condition times out
Date: Thu, 18 Jul 2024 13:53:00 +0200
Message-ID: <CA+bJJbzBRMuoWCW6i36s7qD25pH8K175A=vbPALw0ABtPCQT0g@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
<[email protected]>
On Thu, 18 Jul 2024 at 11:38, [email protected]
<[email protected]> wrote:
> Hello,
> PG V11
>
> Select count(*) from table1
> Returns 10456432
>
> Select field1, field2 from table1 where field3> '2024-07-18 12:00:00'
> Times out
How do you send the query / how does it time out? Is that the real
query? Is table a table or a view? What does explain say?
> Any possible way(s) to do this?
If your client is timing out, increase timeout, if imposible you can
try fetching in batches, but more detail would be needed.
Suggestions to improve total time had already being given, try to
decrease bloat if you have it, but AFAIK timeouts are configurable, so
it may just be you have a too low timeout.
If it had been working, is field3 indexed? How is the table modified?
Because with a configured timeout, whit an unindexed table ( forcing a
table scan ) the query may be working for years before you hit the bad
spot. Also, the query includes todays date, so I doubt it has been
used for years, probably "a similar one has been used for years", and
probably that is not your real table ( or you have a naming problem ).
Without giving real info, people cannot give you real solutions.
Francisco Olarte.
view thread (3+ messages)
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: Re. Select with where condition times out
In-Reply-To: <CA+bJJbzBRMuoWCW6i36s7qD25pH8K175A=vbPALw0ABtPCQT0g@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox