Re: Random slow queries

From: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
To: <devel(dot)brain99(at)xoxy(dot)net>, <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Random slow queries
Date: 2016-07-19 14:51:14
Message-ID: 18c5074b-be58-3754-fab9-e07abcb17326@BlueTreble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On 6/29/16 1:01 PM, devel(dot)brain99(at)xoxy(dot)net 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

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message trafdev 2016-07-19 14:56:45 Re: less than 2 sec for response - possible?
Previous Message Jim Nasby 2016-07-19 14:47:18 Re: Seeing execution plan of foreign key constraint check?