Re: On Scalability - Mailing list pgsql-hackers

From Greg Stark
Subject Re: On Scalability
Date
Msg-id AANLkTimvi1ou4mSbNzz5j10Er7vO7gscNUq9aMetSqzL@mail.gmail.com
Whole thread Raw
In response to Re: On Scalability  (Vincenzo Romano <vincenzo.romano@notorand.it>)
List pgsql-hackers
On Fri, Oct 8, 2010 at 3:20 AM, Vincenzo Romano
<vincenzo.romano@notorand.it> wrote:
> Do the same conclusions apply to partial indexes?
> I mean, if I have a large number (n>=100 or n>=1000) of partial indexes
> on a single very large table (m>=10**12), how good is the planner to choose the
> right indexes to plan a query?
> Has also this algorithm superlinear complexity?

No, it's also linear. It needs to look at every partial index and
check to see whether it's a candidate for your query. Actually that's
true for regular indexes as well but it has the extra step of proving
that the partial index includes all the rows your query needs which is
not a cheap step.

The size of the table isn't relevant though, except inasmuch as the
savings when actually running the query will be larger for larger
tables so it may be worth spending more time planning queries on large
tables.

-- 
greg


pgsql-hackers by date:

Previous
From: Gabriele Bartolini
Date:
Subject: Italian PGDay 2010, Call for papers
Next
From: Robert Haas
Date:
Subject: Re: Sync Replication with transaction-controlled durability