Re: Index on two columns not used

From: Arnaud Lesauvage
Subject: Re: Index on two columns not used
Date: ,
Msg-id: 453636F1.7000903@freesurf.fr
(view: Whole thread, Raw)
In response to: Re: Index on two columns not used  ("Heikki Linnakangas")
Responses: Re: Index on two columns not used  ("Heikki Linnakangas")
List: pgsql-performance

Tree view

Index on two columns not used  (Arnaud Lesauvage, )
 Re: Index on two columns not used  ("Heikki Linnakangas", )
  Re: Index on two columns not used  (Arnaud Lesauvage, )
   Re: Index on two columns not used  ("Heikki Linnakangas", )
    Re: Index on two columns not used  (Arnaud Lesauvage, )
     Re: Index on two columns not used  ("Heikki Linnakangas", )
      Re: Index on two columns not used  (Arnaud Lesauvage, )
  Re: Index on two columns not used  (Péter Kovács, )
   Re: Index on two columns not used  (Markus Schaber, )
    Re: Index on two columns not used  (Alvaro Herrera, )
     Re: Index on two columns not used  (Markus Schaber, )
      Re: Index on two columns not used  (Tom Lane, )
       Re: Index on two columns not used  (Markus Schaber, )
    Re: Index on two columns not used  (Péter Kovács, )
 Re: Index on two columns not used  (Tom Lane, )
  Re: Index on two columns not used  (Arnaud Lesauvage, )

Heikki Linnakangas a écrit :
> Arnaud Lesauvage wrote:
>> This query was taken from my "adminsitrative areas" model (continents,
>> countries, etc...). Whenever I query this model, I have to join many
>> tables.
>> I don't really know what the overhead of reading the heap-tuples is, but
>> would it be a good idea to add data-redundancy in my tables to avoid
>> joins ? (adding country_id, continent_id, etc... in the "cities" table)
>
> It depends. I would advise not to denormalize unless you really really
> have to. It's hard to say without more knowledge of the application.
>
> Is the query you showed a typical one? It ran in about 160 ms, is that
> good enough? It's doesn't sound too bad, considering that it returned
> almost 40000 rows.


It is quite typical, yes. It is the base query of a view. In
fact, most views have a lot more joins (they join with all
the upper-level tables).
But 150ms is OK, indeed.


pgsql-performance by date:

From: Dimitri Fontaine
Date:
Subject: Re: Postgresql 8.1.4 - performance issues for select on view using max
From: "Joshua Marsh"
Date:
Subject: Re: Postgresql 8.1.4 - performance issues for select on view using max