Re: Index ot being used
| От | Bruno Wolff III |
|---|---|
| Тема | Re: Index ot being used |
| Дата | |
| Msg-id | 20050613031317.GA18988@wolff.to обсуждение исходный текст |
| Ответ на | Re: Index ot being used (Bruno Wolff III <bruno@wolff.to>) |
| Ответы |
Re: Index ot being used
|
| Список | pgsql-performance |
On Sun, Jun 12, 2005 at 22:00:01 -0500, Bruno Wolff III <bruno@wolff.to> wrote: > On Sun, Jun 12, 2005 at 18:52:05 -0400, > Madison Kelly <linux@alteeve.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. I didn't notice that you had changed the index. The reason this index doesn't help is that you can't use it to select on records with the desired file_type. > > 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; > > ---------------------------(end of broadcast)--------------------------- > TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/docs/faq
В списке pgsql-performance по дате отправления: