pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: allenwu1973@yahoo.co.jp
Subject: BUG #15491: index on function not being used for full text search when querying through a view
Date: Wed, 07 Nov 2018 08:30:20 +0000
Message-ID: <15491-5bd96f27a237da50@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      15491
Logged by:          Allen Wu
Email address:      allenwu1973@yahoo.co.jp
PostgreSQL version: 11.0
Operating system:   linux
Description:        

Hi

I'm trying to implement full text search with PostgreSQL,
I found when using a function create index in conjunction with querying
through a view, will cause postgres not to use the index.
Below are example for each scenario.

When only using expression index, the index is used
https://dbfiddle.uk/?rdbms=postgres_11&fiddle=16ed7a04389ebf71dc5a1fb2daa34058

When only using view, the index is also used
https://dbfiddle.uk/?rdbms=postgres_11&fiddle=e8d50181b8612421773c2da39e45c9fd

view + expression, the index is NOT used 
https://dbfiddle.uk/?rdbms=postgres_11&fiddle=19d7b923514f100f6e402b54624cc972

I've avoid using function in my app, but I think this should have worked.
Thank you



view thread (2+ messages)  latest in thread

Message-ID: <15491-5bd96f27a237da50@postgresql.org>
Permalink:  ../15491-5bd96f27a237da50@postgresql.org/
Also on:    postgresql.org/message-id/15491-5bd96f27a237da50@postgresql.org

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, allenwu1973@yahoo.co.jp
  Subject: Re: BUG #15491: index on function not being used for full text search when querying through a view
  In-Reply-To: <15491-5bd96f27a237da50@postgresql.org>
  References: <15491-5bd96f27a237da50@postgresql.org>

* 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