From: will trillich <will@serensoft.com>
To: pgsql-general@postgresql.org
Subject: Re: ORDER BY what?
Date: Mon, 11 Jun 2001 17:37:33 -0500
Message-ID: <20010611173733.B29434@serensoft.com> (raw)
In-Reply-To: <01061111193103.29653@bugs>
References: <01061111193103.29653@bugs>
On Mon, Jun 11, 2001 at 11:19:31AM +0300, Mart?n Marqu?s wrote:
> I have a quite complex select query on postgres (obviously :-) ) using PHP
> (which is not the problem at the moment) which has some text searches using
> LIKE.
> My question is: "How can I write an ORDER BY statment so that it's ordered by
> the amount of matches it gets?"
> Is this posible without getting ichy with the programing?
<guess>
not likely. :) sounds like programming is gonna be
required.
you may be better off with some of the "contrib" features
including full-text-index (of which i have no working
knowledge). or a fancy pl/pgsql function. or a mod_perl glue
layer to coordinate your results...
</guess>
and using LIKE can be a serious performance drag if you use the
leading percent: "...LIKE '%this%'..." can't use any indexes
so it'll scan the whole database stem to stern. if you can stick
with "...LIKE 'this%'..." it'll at least be able to use the
indexes.
--
I figure: if a man's gonna gamble, may as well do it
without plowing. -- Bama Dillert, "Some Came Running"
will@serensoft.com
http://sourceforge.net/projects/newbiedoc -- we need your brain!
http://www.dontUthink.com/ -- your brain needs us!
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-sql@postgresql.org
Cc: will@serensoft.com, pgsql-general@postgresql.org
Subject: Re: ORDER BY what?
In-Reply-To: <20010611173733.B29434@serensoft.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