Re: Index ot being used

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Madison Kelly <linux(at)alteeve(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Index ot being used
Date: 2005-06-13 03:00:01
Message-ID: 20050613030001.GB17491@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Sun, Jun 12, 2005 at 18:52:05 -0400,
Madison Kelly <linux(at)alteeve(dot)com> wrote:
>
> After sending that email I kept plucking away and in the course of
> doing so decided that I didn't need to return the 'file_type' column.
> Other than that, it would see my query now matches what you two have
> recommended in the 'ORDER BY...' front but I still can't get an index
> search.

No it doesn't. Even if you don't return file_type you still need it
in the order by clause if you want postgres to consider using your
index.

Is there some reason you didn't actually try out our suggestion, but are
now asking for more advice?

>
> Here is the latest query and the new index:
>
> tle-bu=> \d file_info_7_display_idx;
> Index "public.file_info_7_display_idx"
> Column | Type
> -----------------+------
> file_parent_dir | text
> file_name | text
> btree, for table "public.file_info_7"
>
> tle-bu=> EXPLAIN ANALYZE SELECT file_parent_dir, file_name, file_display
> FROM file_info_7 WHERE file_type='d' ORDER BY file_parent_dir ASC,
> file_name ASC;

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Bruno Wolff III 2005-06-13 03:13:17 Re: Index ot being used
Previous Message Mark Kirkwood 2005-06-13 02:43:41 Re: Updates on large tables are extremely slow