Why is there a tenfold difference between Postgres's alleged query execution time and packet transmission time?

2021-04-15 Thread Rollo Konig-Brock
Hey all, I've been pulling my hair out over this for days now, as I'm trying to build a low latency application. Databases should be fast, but I can not work out why so much latency is added between the actual database process and the application code. For simple queries, that should take less tha

Strange behavior once statistics are there

2021-04-15 Thread Daniel Westermann (DWE)
Hi, I currently have a strange behavior once statistics are collected. This is the statement (I don't know the application, the statement is as it is): explain (analyze, buffers) select distinct standardzi4_.code as col_0_0_, person1_.personalnummer as col_1_0_,

Is there a way to change current time?

2021-04-15 Thread Warstone
Hi,   Is there any way to set time that CURRENT_TIMESTAMP and/or now() will give next time? (We need it only for testing purposes so if there is any hack, cheat, etc. It will be fine)        

Re: Is there a way to change current time?

2021-04-15 Thread Bruce Momjian
On Thu, Apr 15, 2021 at 04:45:44PM +0300, [email protected] wrote: > Hi, > > Is there any way to set time that CURRENT_TIMESTAMP and/or now() will give > next > time? (We need it only for testing purposes so if there is any hack, cheat, > etc. It will be fine) No, it gets the time from the opera

Re: Is there a way to change current time?

2021-04-15 Thread Justin Pryzby
On Thu, Apr 15, 2021 at 09:58:23AM -0400, Bruce Momjian wrote: > On Thu, Apr 15, 2021 at 04:45:44PM +0300, [email protected] wrote: > > Hi, > > > > Is there any way to set time that CURRENT_TIMESTAMP and/or now() will give > > next > > time? (We need it only for testing purposes so if there is an

Re: Is there a way to change current time?

2021-04-15 Thread Tom Lane
Bruce Momjian writes: > On Thu, Apr 15, 2021 at 04:45:44PM +0300, [email protected] wrote: >> Is there any way to set time that CURRENT_TIMESTAMP and/or now() will give >> next >> time? (We need it only for testing purposes so if there is any hack, cheat, >> etc. It will be fine) > No, it gets th

Re: Is there a way to change current time?

2021-04-15 Thread Pavel Stehule
Hi čt 15. 4. 2021 v 15:45 odesílatel [email protected] napsal: > Hi, > > Is there any way to set time that CURRENT_TIMESTAMP and/or now() will give > next time? (We need it only for testing purposes so if there is any hack, > cheat, etc. It will be fine) > This is a bad way - don't use now() in

Re: Is there a way to change current time?

2021-04-15 Thread Eugene Pazhitnov
select pg_sleep(1); чт, 15 апр. 2021 г. в 16:45, [email protected] : > Hi, > > Is there any way to set time that CURRENT_TIMESTAMP and/or now() will give > next time? (We need it only for testing purposes so if there is any hack, > cheat, etc. It will be fine) > > > > > -- Evgeny Pazhitnov

Re: Strange behavior once statistics are there

2021-04-15 Thread Tom Lane
"Daniel Westermann (DWE)" writes: > I currently have a strange behavior once statistics are collected. This is > the statement (I don't know the application, the statement is as it is): I think your problem is with the subplan conditions, ie > and (person1_.id in >(select persons6_.pe

Re: Disabling options lowers the estimated cost of a query

2021-04-15 Thread Arne Roland
The startup cost is pretty expensive. This seems to be common issue using partition wise joins. I attached a simplified reproducer. Thanks for having a look! Regards Arne From: Tom Lane Sent: Friday, February 26, 2021 4:00:18 AM To: Arne Roland Cc: pgsql-per

Re: Disabling options lowers the estimated cost of a query

2021-04-15 Thread Tomas Vondra
On 2/26/21 4:00 AM, Tom Lane wrote: > Arne Roland writes: >> I want to examine the exhaustive search and not the geqo here. I'd >> expect the exhaustive search to give the plan with the lowest cost, >> but apparently it doesn't. I have found a few dozen different >> querys where that isn't the ca

Re: Strange behavior once statistics are there

2021-04-15 Thread Daniel Westermann (DWE)
From: Tom Lane Sent: Thursday, April 15, 2021 17:00 To: Daniel Westermann (DWE) Cc: [email protected] Subject: Re: Strange behavior once statistics are there   >I'd suggest trying to flatten these to be regular joins, ie >try to bring up persons6_ and stufen7_ into the mai