Performance issue 6.5 versus 7.0 - Mailing list pgsql-general
From | Herbert Liechti |
---|---|
Subject | Performance issue 6.5 versus 7.0 |
Date | |
Msg-id | 392ED785.17E8B6CE@thinx.ch Whole thread Raw |
Responses |
Re: Performance issue 6.5 versus 7.0
Re: Performance issue 6.5 versus 7.0 |
List | pgsql-general |
I made an upgrade these days to 7.0 for one machine. I noticed a better performance in general. Congratulation. I have one problem with a query which is joining 3 tables and which is returning one record. In 6.5.3 the results came up immediately. In 7.0 the same query takes about 5 seconds. Here the explain results (Same database with the same amount of records and same indexes, vacuum was executed before) Query under 6.5.3: ------------------ EXPLAIN SELECT MailingListe_Id, MailingStatus, AbschlussDatum, Anschrift.Anzeige, Anschrift.Postfach, Anschrift.Strasse, Anschrift.Plz, Anschrift.Ort, Anschrift.TelDirekt, Person.Person_Id, Person.Name, Person.Vorname, Person.Anzeige FROM Anschrift, Person, MailingListe WHERE Person.Person_Id = MailingListe.Person_Id AND Anschrift.Anschrift_Id = MailingListe.Anschrift_Id AND MailingListe_Id = 2104; NOTICE: QUERY PLAN: Nested Loop (cost=53.30 rows=23 width=513) -> Nested Loop (cost=6.15 rows=23 width=232) -> Index Scan using mailingliste_id_ix on mailingliste (cost=2.05 rows=2 width=36) -> Index Scan using person_id_ix on person (cost=2.05 rows=24051 width=196) -> Index Scan using anschrift_id_ix on anschrift (cost=2.05 rows=13661 width=281) result is returned immediately on a Pentium II Query under 7.0 --------------- Same query: NOTICE: QUERY PLAN: Merge Join (cost=5991.20..6395.18 rows=1988449 width=136) -> Sort (cost=2984.98..2984.98 rows=8268 width=96) -> Merge Join (cost=2037.87..2209.39 rows=8268 width=96) -> Sort (cost=1993.14..1993.14 rows=13661 width=76) -> Seq Scan on anschrift (cost=0.00..728.61 rows=13661 width=76) -> Sort (cost=44.73..44.73 rows=61 width=20) -> Index Scan using mailingliste_id_ix on mailingliste (cost=0.00..42.94 rows=61 width=20) -> Sort (cost=3006.22..3006.22 rows=24051 width=40) -> Seq Scan on person (cost=0.00..896.51 rows=24051 width=40) Select takes about 5 seconds on Pentium III/550 Mhz When I do a select * From those tables I get the same query plan under 6.5.3 and a different query plan und 7.0; NOTICE: QUERY PLAN (7.0) Merge Join (cost=4201.39..8326.56 rows=1988449 width=513) -> Index Scan using person_id_ix on person (cost=0.00..3721.19 rows=24051 width=196) -> Sort (cost=4201.39..4201.39 rows=8268 width=317) -> Merge Join (cost=44.73..2941.79 rows=8268 width=317) -> Index Scan using anschrift_id_ix on anschrift (cost=0.00..2725.55 rows=13661 width=281) -> Sort (cost=44.73..44.73 rows=61 width=36) -> Index Scan using mailingliste_id_ix on mailingliste (cost=0.00..42.94 rows=61 width=36) Is there a way to force 7.0 using the defined indexes? Thanks for your help. Greetings Herbie -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Herbert Liechti E-Mail: Herbert.Liechti@thinx.ch ThinX networked business services Stahlrain 10, CH-5200 Brugg ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pgsql-general by date: