pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kevin Grittner <Kevin.Grittner@wicourts.gov>
To: Grzegorz Blinowski <g.blinowski@gmail.com>
To: pgsql-performance@postgresql.org
Subject: Re: poor pefrormance with regexp searches on large tables
Date: Fri, 12 Aug 2011 10:25:16 -0500
Message-ID: <4E44FF8C020000250003FE35@gw.wicourts.gov> (raw)
In-Reply-To: <CAF=aNMHrvpCdZT2yajmBpqKZmxf828ejddo2RzmGZaKnH9niwg@mail.gmail.com>
References: <CAF=aNMHHzBKE8_P0LykDb8Bvk7eHKdytcZ9xAkz=gtpeTj87+w@mail.gmail.com>
	<4E425D2D020000250003FD32@gw.wicourts.gov>
	<CAF=aNMGRCcO+Cu3PSPL=m_OOSKOhZ+-O0uht=LQDes=7y=VfBw@mail.gmail.com>
	<4E4276E8020000250003FD52@gw.wicourts.gov>
	<CAF=aNMGUu7zJxw4doqcMhFdVmYkAh+0bBpL_+Fqjqa4wvJ-9Yg@mail.gmail.com>
	<4E43992E020000250003FD9D@gw.wicourts.gov>
	<CAF=aNMHrvpCdZT2yajmBpqKZmxf828ejddo2RzmGZaKnH9niwg@mail.gmail.com>

Grzegorz Blinowski <g.blinowski@gmail.com> wrote:
 
> 2) changing long attribute storage to EXTERNAL gave 30% better
> search time (but only on the first search - i.e. before data is
> cached)
 
That suggests that all of the following are true:
 
(1)  The long value was previously being compressed and stored
in-line.
 
(2)  It's now being stored uncompressed, out-of-line in the TOAST
table.
 
(3)  Following the TOAST pointers on cached tuples isn't
significantly more or less expensive than decompressing the data.
 
(4)  The smaller base tuple caused fewer page reads from disk, even
with the out-of-line storage for the large value.
 
The first three aren't surprising; that last one is.  Unless there
is significant bloat of the table, I'm having trouble seeing why
that first run is cheaper this way.  Make sure your vacuum policy is
aggressive enough; otherwise you will probably see a slow but steady
deterioration in performance..
 
-Kevin



view thread (13+ messages)

Message-ID: <4E44FF8C020000250003FE35@gw.wicourts.gov>
Permalink:  ../4E44FF8C020000250003FE35@gw.wicourts.gov/
Also on:    postgresql.org/message-id/4E44FF8C020000250003FE35@gw.wicourts.gov

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: Kevin.Grittner@wicourts.gov, g.blinowski@gmail.com
  Subject: Re: poor pefrormance with regexp searches on large tables
  In-Reply-To: <4E44FF8C020000250003FE35@gw.wicourts.gov>
  References: <CAF=aNMHHzBKE8_P0LykDb8Bvk7eHKdytcZ9xAkz=gtpeTj87+w@mail.gmail.com> <4E425D2D020000250003FD32@gw.wicourts.gov> <CAF=aNMGRCcO+Cu3PSPL=m_OOSKOhZ+-O0uht=LQDes=7y=VfBw@mail.gmail.com> <4E4276E8020000250003FD52@gw.wicourts.gov> <CAF=aNMGUu7zJxw4doqcMhFdVmYkAh+0bBpL_+Fqjqa4wvJ-9Yg@mail.gmail.com> <4E43992E020000250003FD9D@gw.wicourts.gov> <CAF=aNMHrvpCdZT2yajmBpqKZmxf828ejddo2RzmGZaKnH9niwg@mail.gmail.com> <4E44FF8C020000250003FE35@gw.wicourts.gov>

* 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