From: Christopher Petrilli <petrilli@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: jd@commandprompt.com, "Marc G. Fournier" <scrappy@postgresql.org>
Cc: pgsql-performance@postgresql.org
Subject: Re: Sustained inserts per sec ... ?
Date: Mon, 4 Apr 2005 12:09:35 -0400
Message-ID: <59d991c405040409094e7bbd17@mail.gmail.com> (raw)
In-Reply-To: <26454.1112629979@sss.pgh.pa.us>
References: <20050401140421.P18194@ganymede.hub.org>
<59d991c4050401113857086517@mail.gmail.com>
<28353.1112388128@sss.pgh.pa.us>
<59d991c4050401124638c4ab5d@mail.gmail.com>
<1112388818.3487.34.camel@jd2.commandprompt.com>
<59d991c4050401125956d6069d@mail.gmail.com>
<59d991c40504040648457808e9@mail.gmail.com>
<26454.1112629979@sss.pgh.pa.us>
On Apr 4, 2005 11:52 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Christopher Petrilli <petrilli@gmail.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@gmail.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: petrilli@gmail.com, tgl@sss.pgh.pa.us, scrappy@postgresql.org
Subject: Re: Sustained inserts per sec ... ?
In-Reply-To: <59d991c405040409094e7bbd17@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox