pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Greg Stark <gsstark@mit.edu>
To: Andrea Arcangeli <andrea@cpushare.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-performance@postgresql.org
Subject: Re: NOT LIKE much faster than LIKE?
Date: 10 Jan 2006 10:11:18 -0500
Message-ID: <87y81oyv6x.fsf@stark.xeocode.com> (raw)
In-Reply-To: <20060110034721.GC20168@opteron.random>
References: <20060110014447.GB18474@opteron.random>
	<24021.1136858688@sss.pgh.pa.us>
	<20060110022303.GA20168@opteron.random>
	<24372.1136861684@sss.pgh.pa.us>
	<20060110034721.GC20168@opteron.random>


Andrea Arcangeli <andrea@cpushare.com> writes:

> Fixing this with proper stats would be great indeed. What would be the
> most common value for the kernel_version? You can see samples of the
> kernel_version here http://klive.cpushare.com/2.6.15/ .  That's the
> string that is being searched against both PREEMPT and SMP.

Try something like this where attname is the column name and tablename is,
well, the tablename:

db=> select most_common_vals from pg_stats where tablename = 'region' and attname = 'province';
 most_common_vals 
------------------
 {ON,NB,QC,BC}

Note that there's a second column most_common_freqs and to do this would
really require doing a weighted average based on the frequencies.

-- 
greg




view thread (26+ messages)  latest in thread

Message-ID: <87y81oyv6x.fsf@stark.xeocode.com>
Permalink:  ../87y81oyv6x.fsf@stark.xeocode.com/
Also on:    postgresql.org/message-id/87y81oyv6x.fsf@stark.xeocode.com

 · 

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: pgsql-performance@postgresql.org
  Cc: gsstark@mit.edu, andrea@cpushare.com, tgl@sss.pgh.pa.us
  Subject: Re: NOT LIKE much faster than LIKE?
  In-Reply-To: <87y81oyv6x.fsf@stark.xeocode.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