Re: Disabling options lowers the estimated cost of a query

2021-04-16 Thread Tomas Vondra
Hi, On 4/16/21 3:09 PM, Tom Lane wrote: > I wrote: >> ... The code to select the >> right child path would be approximately like get_cheapest_fractional_path, >> except that you need to restrict it to paths with the right sort order. > > Duh, I forgot about get_cheapest_fractional_path_for_pathke

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

2021-04-16 Thread Tom Lane
Rollo Konig-Brock writes: > 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,

Re: Disabling options lowers the estimated cost of a query

2021-04-16 Thread Tom Lane
I wrote: > ... The code to select the > right child path would be approximately like get_cheapest_fractional_path, > except that you need to restrict it to paths with the right sort order. Duh, I forgot about get_cheapest_fractional_path_for_pathkeys(). regards, tom lane

Re: Disabling options lowers the estimated cost of a query

2021-04-16 Thread Tom Lane
Tomas Vondra writes: > On 2/26/21 4:00 AM, Tom Lane wrote: >> Hmm. While the search should be exhaustive, there are pretty >> aggressive pruning heuristics (mostly in and around add_path()) that >> can cause us to drop paths that don't seem to be enough better than >> other alternatives. I suspec