Re: index speed-up and automatic tables/procedures creation

From: "Jean-Yves F(dot) Barbier" <12ukwn(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: index speed-up and automatic tables/procedures creation
Date: 2009-11-27 14:21:03
Message-ID: 4B0FE04F.80208@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Tom Lane a écrit :
> "Jean-Yves F. Barbier" <12ukwn(at)gmail(dot)com> writes:
>> 1)- I'd like to keep a table in one piece, but it'll be huge (several millions rows
>> and growing); can a segmentation of indexes (all indexes that are used for
>> searching) speed-up this table scans enough to keep it as responsive to queries as
>> multiple tables? And what can I do about the primary key index, which is monolitic?
>> (I can't use inheritance as there are some integrity references into it.)
>
> I think you're wasting your time. What you are setting out to do here
> is manually emulate the top layer or so of a large index. Unless you
> have very specific (and unusual) data access patterns that you know in
> considerable detail, this is not a game you are going to win. Just go
> with the one big table and one index, you'll be happier. (Note that
> "several million rows" is not big, it's barely enough to notice.)
>
> You will see a lot of discussion about partitioning of tables if you
> look around the list archives, but this is not done with the idea that
> it makes access to any one row faster. The biggest motivation usually
> is to allow dropping ranges of data cheaply, like throwing away a month's
> or year's worth of old data at once.
>
> regards, tom lane

That's a *very* clear answer, thanks Tom!

JY
--
If a thing's worth having, it's worth cheating for.
-- W. C. Fields

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Nathaniel Trellice 2009-11-27 14:44:53 Re: How best to index foreign key for inner join
Previous Message Jean-Yves F. Barbier 2009-11-27 14:18:54 Re: bytea and text