Re: Same query doing slow then quick

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Oh ok. But what is this command doing ? i'm gonna runn it today. I'll keep you posted. Here is some EXPLAIN ANALYZE from the querys :


Nested Loop  (cost=0.00..353722.89 rows=124893 width=16) (actual time=261158.061..10304193.501 rows=99 loops=1)
  Join Filter: ((t2."X" >= (t1.x_min)::double precision) AND (t2."X" <= (t1.x_max)::double precision) AND (t2."Y" >= (t1.y_min)::double precision) AND (t2."Y" <= (t1.y_max)::double precision))
  ->  Seq Scan on gps_22 t1  (cost=0.00..3431.80 rows=177480 width=44) (actual time=0.036..1399.621 rows=177480 loops=1)
  ->  Materialize  (cost=0.00..20572.83 rows=57 width=20) (actual time=0.012..10.274 rows=2924 loops=177480)
        ->  Seq Scan on adresses_22 t2  (cost=0.00..20572.55 rows=57 width=20) (actual time=1570.240..1726.376 rows=2924 loops=1)
              Filter: ((id_maille_200m)::text = '0'::text)
Total runtime: 10304211.648 ms


Nested Loop  (cost=0.00..88186069.17 rows=33397899 width=16) (actual time=3060.373..3060.373 rows=0 loops=1)
  Join Filter: ((t2."X" >= (t1.x_min)::double precision) AND (t2."X" <= (t1.x_max)::double precision) AND (t2."Y" >= (t1.y_min)::double precision) AND (t2."Y" <= (t1.y_max)::double precision))
  ->  Seq Scan on gps_31 t1  (cost=0.00..3096.38 rows=161738 width=44) (actual time=4.612..442.935 rows=161738 loops=1)
  ->  Materialize  (cost=0.00..12562.25 rows=16726 width=20) (actual time=0.012..0.012 rows=0 loops=161738)
        ->  Seq Scan on adresses_31 t2  (cost=0.00..12478.62 rows=16726 width=20) (actual time=1504.082..1504.082 rows=0 loops=1)
              Filter: ((id_maille_200m)::text = '0'::text)
Total runtime: 3060.469 ms

Nested Loop  (cost=0.00..84287659.70 rows=31920943 width=64) (actual time=220198.891..32665395.631 rows=21409 loops=1)
  Join Filter: ((t2."X" >= (t1.x_min)::double precision) AND (t2."X" <= (t1.x_max)::double precision) AND (t2."Y" >= (t1.y_min)::double precision) AND (t2."Y" <= (t1.y_max)::double precision))
  ->  Seq Scan on gps_67 t1  (cost=0.00..2350.55 rows=121555 width=44) (actual time=0.038..1570.994 rows=121555 loops=1)
  ->  Materialize  (cost=0.00..14072.09 rows=21271 width=20) (actual time=0.001..34.394 rows=22540 loops=121555)
        ->  Seq Scan on adresses_67 t2  (cost=0.00..13965.74 rows=21271 width=20) (actual time=0.032..1283.087 rows=22540 loops=1)
              Filter: ((id_maille_200m)::text = '0'::text)
Total runtime: 32665478.631 ms


Rude - Last Territory

Ou écouter ?

Ou acheter ?
La Fnac

iTunes


> Date: Wed, 26 Sep 2012 19:30:30 +0300
> Subject: Re: Same query doing slow then quick
> From: lystor@xxxxxxxxx
> To: FFW_Rude@xxxxxxxxxxx
> CC: pgsql-performance@xxxxxxxxxxxxxx
>
> On 26 September 2012 19:09, FFW_Rude <FFW_Rude@xxxxxxxxxxx> wrote:
> > Could you explain what you are asking me to do because i don't really know
> > what i'm doing...
>
> postgresql-contrib packages contains pgbench tool on Ubuntu.
>
> For example postgresql-contrib-9.1_9.1.3-2_i386.deb on Ubuntu 12.04 contains:
> /usr/lib/postgresql/9.1/bin/pgbench
>
>
> > i don't have pgbench in it. It is still pgbench command not found...
>
> You need to run pgbench as postgres user.
> For example on CentOS:
> # su - postgres
> $ pgbench -i pgbench && pgbench -c 10 -t 10000 pgbench
>
>
> --
> With best regards,
> Nikolay

[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux