Re: Planner should use index on a LIKE 'foo%' query - Mailing list pgsql-performance

From Moritz Onken
Subject Re: Planner should use index on a LIKE 'foo%' query
Date
Msg-id 2EAD1377-002D-4155-B9FB-6D52A46281B7@houseofdesign.de
Whole thread Raw
In response to Re: Planner should use index on a LIKE 'foo%' query  (Matthew Wakeling <matthew@flymine.org>)
List pgsql-performance
>
>
> However there's a lot more scope for improving a query along these
> lines, like adding indexes, or CLUSTERing on an index. It depends
> what other queries you are wanting to run.
>
> I don't know how much update/insert activity there will be on your
> database. However, if you were to add an index on the URL on both
> tables, then CLUSTER both tables on those indexes, and ANALYSE, then
> this query should run as a merge join, and be pretty quick.
>
> However, this is always going to be a long-running query, because it
> accesses at least one whole table scan of a large table.
>
> Matthew

There are already indexes on the url columns. I didn't cluster yet but
this is a pretty good idea, thanks. There will be no updates or
inserts. It's static data for research purposes.

moritz

pgsql-performance by date:

Previous
From: Matthew Wakeling
Date:
Subject: Re: Planner should use index on a LIKE 'foo%' query
Next
From: "Marko Kreen"
Date:
Subject: Re: Federated Postgresql architecture ?