public inbox for [email protected]  
help / color / mirror / Atom feed
From: Jim Nasby <[email protected]>
To: [email protected]
To: [email protected]
Subject: Re: Random slow queries
Date: Tue, 19 Jul 2016 09:51:14 -0500
Message-ID: <[email protected]> (raw)
In-Reply-To: <CACjsgDkTS83P7RYwvCBWveGNUR4aO4TowqEWemJhqz04UTpftA@mail.gmail.com>
References: <CACjsgDm+n0s=5cMwGF7nRMXS8fX6CF9t1HsOr_M2iejpxKgS1A@mail.gmail.com>
	<CACjxUsMncEHCHsPoAJP+XuOVKJrP2ftF4TRZEuCyiM6Gb4OZ_w@mail.gmail.com>
	<CACjsgDkTS83P7RYwvCBWveGNUR4aO4TowqEWemJhqz04UTpftA@mail.gmail.com>
List-Unsubscribe:  <mailto:[email protected]?body=unsub%20pgsql-performance>

On 6/29/16 1:01 PM, [email protected] wrote:
> During my test run, there was one offending query invocation, a simple
> SELECT * FROM job WHERE field = $1
> Of course the actual query specified the list of fields as it was generated
> by Hibernate, but that is what it boils down to - no joins etc. The column on
> which was queried is a VARCHAR(64) NOT NULL, not unique nor indexed (though
> in practice most values are unique).

Be careful about your assumptions there... SELECT * can have redically 
different performance than selecting individual fields. In particular, 
if you select something that's been toasted external, that's going to 
produce it's own index scan of the toast table, which could then run 
into conflicts with vacuuming.
-- 
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com
855-TREBLE2 (855-873-2532)   mobile: 512-569-9461


-- 
Sent via pgsql-performance mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance




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 using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Random slow queries
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox