Unix Technical Forum

Antw: Re: Performance problem with query

This is a discussion on Antw: Re: Performance problem with query within the Pgsql General forums, part of the PostgreSQL category; --> now finally after a long time i have the query plan for the whole filled table. I hope somebody ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-09-2008, 11:39 AM
Christian Rengstl
 
Posts: n/a
Default Antw: Re: Performance problem with query

now finally after a long time i have the query plan for the whole filled
table. I hope somebody can explain me why it takes so much longer...

QUERY PLAN

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-----
Result (cost=0.09..254643.09 rows=8044000 width=39) (actual
time=0.043..0.043
rows=0 loops=1)
One-Time Filter: ((((split_part(($1)::text, '_'::text, 2))::smallint =
1) IS
NOT TRUE) AND (((split_part(($2)::text, '_'::text, 2))::smallint = 22)
IS NOT TR
UE))
InitPlan
-> Limit (cost=0.00..0.02 rows=1 width=10) (never executed)
-> Seq Scan on temp_table (cost=0.00..194313.00 rows=8044000
width=
10) (never executed)
-> Limit (cost=0.00..0.02 rows=1 width=10) (actual
time=0.006..0.006 rows
=1 loops=1)
-> Seq Scan on temp_table (cost=0.00..194313.00 rows=8044000
width=
10) (actual time=0.004..0.004 rows=1 loops=1)
-> Limit (cost=0.00..0.02 rows=1 width=10) (never executed)
-> Seq Scan on temp_table (cost=0.00..194313.00 rows=8044000
width=
10) (never executed)
-> Seq Scan on temp_table (cost=0.00..194313.00 rows=8044000
width=39) (nev
er executed)
Total runtime: 0.238 ms

Result (cost=0.06..254643.06 rows=8044000 width=39) (actual
time=0.056..655772
..273 rows=8044000 loops=1)
One-Time Filter: ((split_part(($1)::text, '_'::text, 2))::smallint =
1)
InitPlan
-> Limit (cost=0.00..0.02 rows=1 width=10) (actual
time=0.003..0.003 rows
=1 loops=1)
-> Seq Scan on temp_table (cost=0.00..194313.00 rows=8044000
width=
10) (actual time=0.002..0.002 rows=1 loops=1)
-> Limit (cost=0.00..0.02 rows=1 width=10) (actual
time=0.006..0.007 rows
=1 loops=1)
-> Seq Scan on temp_table (cost=0.00..194313.00 rows=8044000
width=
10) (actual time=0.004..0.004 rows=1 loops=1)
-> Seq Scan on temp_table (cost=0.00..194313.00 rows=8044000
width=39) (act
ual time=0.002..191672.344 rows=8044000 loops=1)
Total runtime: 62259544.896 ms

Result (cost=0.06..254643.06 rows=8044000 width=39) (actual
time=1.245..1.245
rows=0 loops=1)
One-Time Filter: ((split_part(($1)::text, '_'::text, 2))::smallint =
22)
InitPlan
-> Limit (cost=0.00..0.02 rows=1 width=10) (never executed)
-> Seq Scan on temp_table (cost=0.00..194313.00 rows=8044000
width=
10) (never executed)
-> Limit (cost=0.00..0.02 rows=1 width=10) (actual
time=0.013..0.014 rows
=1 loops=1)
-> Seq Scan on temp_table (cost=0.00..194313.00 rows=8044000
width=
10) (actual time=0.009..0.009 rows=1 loops=1)
-> Seq Scan on temp_table (cost=0.00..194313.00 rows=8044000
width=39) (nev
er executed)
Total runtime: 22.270 ms
(31 Zeilen)



>>> "Merlin Moncure" <mmoncure@gmail.com> 13.07.06 15.20 Uhr >>>

On 7/13/06, Christian Rengstl
<Christian.Rengstl@klinik.uni-regensburg.de> wrote:
> Good morning list,
>
> the following query takes about 15 to 20 minutes for around 2 million

lines in the file myfile.txt, but with 8 million lines it takes around 5
hours and i just don't understand why there is such a huge discrepancy
in performance.


on the surface it doesn't make sense, can you post an explain analyze?

merlin

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

>>> "Merlin Moncure" <mmoncure@gmail.com> 13.07.06 15.20 Uhr >>>

On 7/13/06, Christian Rengstl
<Christian.Rengstl@klinik.uni-regensburg.de> wrote:
> Good morning list,
>
> the following query takes about 15 to 20 minutes for around 2 million

lines in the file myfile.txt, but with 8 million lines it takes around 5
hours and i just don't understand why there is such a huge discrepancy
in performance.


on the surface it doesn't make sense, can you post an explain analyze?

merlin

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster


---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 02:13 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com