Re: Fast Inserts and Hardware Questions

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Orion Henry <orion(at)trustcommerce(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Fast Inserts and Hardware Questions
Date: 2001-03-14 22:08:25
Message-ID: Pine.LNX.4.30.0103142305150.1211-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Orion Henry writes:

> > Since one query can only use one index per table, you should only need the
> > customer_id index, given the queries you listed.
>
> Isn't that was multi-column indexes are for?
>
> I have 100's of customers but millions of database entries. If I have
> to I'll make a table for each customer, big_table_5 and big_table_6
> etc... but this seems to be a terrible hack and the database should be
> able to do things like this for me.

Multi-column indices may be appropriate. You will have to do some
experimenting with actual data to determine the selectivity of the
queries. Indices only make sense for queries that retrieve less than
about 5% of the data (with lots of other deciding factors involved).
Since your application seems to be insert heavy you should try to avoid
too many and too complicated indices.

--
Peter Eisentraut peter_e(at)gmx(dot)net http://yi.org/peter-e/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Roy Souther 2001-03-14 22:24:12 Can I make direct calls to PostgreSQL server?
Previous Message Tom Lane 2001-03-14 22:02:17 Re: COPY problem