Martijn van Oosterhout <kleptog@svana.org> writes:
> Anyway, as a test, if you take the approach that the measurement at
> item X only applies to the tuples immediately preceding it, for the
> data you posted you get a result of 0.681148 seconds. How long did that
> query run that produced that data?
I didn't save the corresponding printout unfortunately, but it was
probably pretty similar to this:
regression=# explain analyze select count(*) from (select * from tenk1 a join tenk1 b on a.unique1 = b.unique2 offset
0)ss; QUERY PLAN
--------------------------------------------------------------------------------------------------------------------------------------Aggregate
(cost=2609.00..2609.01 rows=1 width=0) (actual time=869.395..869.399 rows=1 loops=1) -> Limit (cost=825.00..2484.00
rows=10000width=488) (actual time=248.640..3368.313 rows=10000 loops=1) -> Hash Join (cost=825.00..2484.00
rows=10000width=488) (actual time=248.609..2983.528 rows=10000 loops=1) Hash Cond: (a.unique1 = b.unique2)
-> Seq Scan on tenk1 a (cost=0.00..458.00 rows=10000 width=244) (actual time=0.084..21.525 rows=10000
loops=1) -> Hash (cost=458.00..458.00 rows=10000 width=244) (actual time=248.269..248.269 rows=10000
loops=1) -> Seq Scan on tenk1 b (cost=0.00..458.00 rows=10000 width=244) (actual time=0.025..22.760
rows=10000loops=1)Total runtime: 877.265 ms
(8 rows)
Time: 888.469 ms
regression=#
The above idea won't fix it anyway, only move the failure cases around.
regards, tom lane