From: Andrea Arcangeli <andrea@cpushare.com>
To: Greg Stark <gsstark@mit.edu>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-performance@postgresql.org
Subject: Re: NOT LIKE much faster than LIKE?
Date: Tue, 10 Jan 2006 16:27:20 +0100
Message-ID: <20060110152720.GL15897@opteron.random> (raw)
In-Reply-To: <87y81oyv6x.fsf@stark.xeocode.com>
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>
<87y81oyv6x.fsf@stark.xeocode.com>
On Tue, Jan 10, 2006 at 10:11:18AM -0500, Greg Stark wrote:
>
> 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}
Thanks for the info!
klive=> select most_common_vals from pg_stats where tablename = 'klive' and attname = 'kernel_version';
most_common_vals
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
{"#1 Tue Sep 13 14:56:15 UTC 2005","#1 Fri Aug 19 11:58:59 UTC 2005","#7 SMP Fri Oct 7 15:56:41 CEST 2005","#1 SMP Fri Aug 19 11:58:59 UTC 2005","#2 Thu Sep 22 15:58:44 CEST 2005","#1 Fri Sep 23 15:32:21 GMT 2005","#1 Fri Oct 21 03:46:55 EDT 2005","#1 Sun Sep 4 13:45:32 CEST 2005","#5 PREEMPT Mon Nov 21 17:53:59 EET 2005","#1 Wed Sep 28 19:15:10 EDT 2005"}
(1 row)
klive=> select most_common_freqs from pg_stats where tablename = 'klive' and attname = 'kernel_version';
most_common_freqs
-------------------------------------------------------------------------------------------
{0.0133333,0.0116667,0.011,0.009,0.00733333,0.00666667,0.00633333,0.006,0.006,0.00566667}
(1 row)
klive=>
There's only one preempt near the end, not sure if it would work?
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: andrea@cpushare.com, gsstark@mit.edu, tgl@sss.pgh.pa.us
Subject: Re: NOT LIKE much faster than LIKE?
In-Reply-To: <20060110152720.GL15897@opteron.random>
* 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