From: | Christopher Petrilli <petrilli(at)gmail(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | jd(at)commandprompt(dot)com, "Marc G(dot) Fournier" <scrappy(at)postgresql(dot)org>, pgsql-performance(at)postgresql(dot)org |
Subject: | Re: Sustained inserts per sec ... ? |
Date: | 2005-04-04 16:09:35 |
Message-ID: | 59d991c405040409094e7bbd17@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-performance |
On Apr 4, 2005 11:52 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Christopher Petrilli <petrilli(at)gmail(dot)com> writes:
> > The table has:
> > * 21 columns (nothing too strange)
> > * No OIDS
> > * 5 indexes, including the primary key on a string
>
> Could we see the *exact* SQL definitions of the table and indexes?
> Also some sample data would be interesting. I'm wondering for example
> about the incidence of duplicate index keys.
Of course, this is a bit cleansed, since it's an internal project, but
only the column names are changed:
CREATE TABLE foos (
foo_id VARCHAR(32),
s_ts INTEGER NOT NULL,
c_ts INTEGER NOT NULL,
bar_id INTEGER NOT NULL,
proto INTEGER NOT NULL,
src_ip INT8 NOT NULL,
dst_ip INT8 NOT NULL,
src_port INTEGER,
dst_port INTEGER,
nated INTEGER NOT NULL,
src_nat_ip INT8,
dst_nat_ip INT8,
src_nat_port INTEGER,
dst_nat_port INTEGER,
foo_class INTEGER NOT NULL,
foo_type INTEGER NOT NULL,
src_bar INTEGER NOT NULL,
dst_bar INTEGER NOT NULL,
user_name VARCHAR(255),
info TEXT
) WITHOUT OIDS;
ALTER TABLE foos ADD CONSTRAINT foos_foo_id_pk UNIQUE (foo_id);
CREATE INDEX foos_c_ts_idx ON foos(conduit_ts);
CREATE INDEX foos_src_ip_idx ON foos(src_ip);
CREATE INDEX foos_dst_ip_idx ON foos(dst_ip);
CREATE INDEX foos_foo_class_idx ON foos(foo_class);
CREATE INDEX foos_foo_type_idx ON foos(foo_type);
CREATE TABLE foos001 ( ) INHERITS (foos) WITHOUT OIDS;
ALTER TABLE foos001 ADD CONSTRAINT foos001_foo_id_pk UNIQUE (foo_id);
CREATE INDEX foos001_c_ts_idx ON foos001(conduit_ts);
CREATE INDEX foos001_src_ip_idx ON foos001(src_ip);
CREATE INDEX foos001_dst_ip_idx ON foos001(dst_ip);
CREATE INDEX foos001_foo_class_idx ON foos001(foo_class);
CREATE INDEX foos001_foo_type_idx ON foos001(foo_type);
That continues on, but you get the idea...
So, as you asked about data content, specifically regarding indices,
here's what the "simulator" creates:
foo_id - 32 character UID (generated by the UUID function in mxTools,
which looks like '00beef19420053c64f3f01aeb0b4a2a5', and varies in the
upper components more than the lower.
*_ts - UNIX epoch timestamps, sequential. There's a long story behind
not using DATETIME format, but if that's the big issue, it can be
dealt with.
*_ip - Randomly selected 32-bit integers from a pre-generated list
containing about 500 different numbers ranging from 3232235500 to
3232236031. This is unfortunately, not too atypical from the "real
world".
*_class - Randomly selected 1-100 (again, not atypical, although
normal distribution would be less random)
*_type - Randomly selected 1-10000 (not atypical, and more random than
in real world)
Hopefully this helps?
Chris
--
| Christopher Petrilli
| petrilli(at)gmail(dot)com
From | Date | Subject | |
---|---|---|---|
Next Message | Kris Jurka | 2005-04-04 16:15:40 | Re: 8.0.1 performance question. |
Previous Message | alvin.yk | 2005-04-04 16:00:39 | 8.0.1 performance question. |