Re: NOT LIKE much faster than LIKE?

From: Matteo Beccati <php(at)beccati(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrea Arcangeli <andrea(at)cpushare(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: NOT LIKE much faster than LIKE?
Date: 2006-01-10 09:08:45
Message-ID: 43C3799D.5030103@beccati.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hi,

> I did just think of something we could improve though. The pattern
> selectivity code doesn't make any use of the statistics about "most
> common values". For a constant pattern, we could actually apply the
> pattern test with each common value and derive answers that are exact
> for the portion of the population represented by the most-common-values
> list. If the MCV list covers a large fraction of the population then
> this would be a big leg up in accuracy. Dunno if that applies to your
> particular case or not, but it seems worth doing ...

This reminds me what I did in a patch which is currently on hold for the
next release:

http://momjian.postgresql.org/cgi-bin/pgpatches_hold
http://candle.pha.pa.us/mhonarc/patches_hold/msg00026.html

The patch was addressing a similar issue when using ltree <@ and @>
operator on an unbalanced tree.

Best regards
--
Matteo Beccati
http://phpadsnew.com
http://phppgads.com

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Ron 2006-01-10 14:33:20 Re: help tuning queries on large database
Previous Message Alessandro Baretta 2006-01-10 07:46:39 Re: 500x speed-down: Wrong statistics!