Re: [HACKERS] Re: indexing words slow - Mailing list pgsql-hackers

From ocie@paracel.com
Subject Re: [HACKERS] Re: indexing words slow
Date
Msg-id 9803120055.AA29068@dolomite.paracel.com
Whole thread Raw
In response to Re: indexing words slow  (Maarten Boekhold <maartenb@dutepp2.et.tudelft.nl>)
Responses Re: [HACKERS] Re: indexing words slow
Re: [HACKERS] Re: indexing words slow
List pgsql-hackers
Maarten Boekhold wrote:
>
> On Wed, 11 Mar 1998, Bruce Momjian wrote:
>
> > >
> > > Hi,
> > >
> > > I have done a little more testing, and the performance bottleneck
> > > seems definitely be memory related. Note that it does not really seems
> > > to be dependend on buffer-settings, but really on disk caches.
> > >
> > > additional info:
> > >     the index on this table is around 155 Megs big
> > >
> > > Now, if I do a count(*) on '^rol', after the second query, this takes
> > > around 1 second, and returns 2528.
> > >
> > > On the other hand, if I do a count(*) on '^ric', his takes consequently
> > > around 1:30 mins, no matter how often I run it. This returns 7866.
> > >
> > > A search on count(*) of '^lling' and '^tones' takes around 2.5 secs after
> > > running it several times.
>
> btw. to make things clearer on what I mean with '^lling' and '^tones', I
> really mean "'^lling' *AND* '^tones'", ie. a join :) actually pretty good
> don't ya think? :)

This sounds like an unsatisfyable query, perhaps if the database
figured this out, it could return zero rows without even hitting the
index.  If the first item matched, the first character is an 'l', if
the second matches, a 't'.  It can't be both an 'l' and a 't'!

We could also do this for some other queries, like:

select ... from ... where a<b and b<c and c<d

If a and d are parameters to the query (constants), and d<a, then
there can never be a row returned.

Ocie

pgsql-hackers by date:

Previous
From: Michal Mosiewicz
Date:
Subject: Timetravel vs checkpointing and no read-locking
Next
From: Bruce Momjian
Date:
Subject: Re: [QUESTIONS] Does Storage Manager support >2GB tables?