Query with rightmost function does not use index

From: - - <loh(dot)law(at)hotmail(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Query with rightmost function does not use index
Date: 2011-08-08 01:24:07
Message-ID: BAY147-W60E0112B4451E58596D427F0210@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


For a table where column col has an index, the query:
SELECT ... FROM ... WHERE col = MD5('')
doesn't seem to use an index but
SELECT ... FROM ... WHERE col = 'd41d8cd98f00b204e9800998ecf8427e'
does.

Is this a gotcha?
I'm using PostgreSQL 8.4.8 on i686-pc-linux-gnu, compiled by GCC gcc-4.5.real (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2, 32-bit

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2011-08-08 02:09:19 Re: Effect of a kill -9 on postgres
Previous Message Royce Ausburn 2011-08-08 00:52:02 Effect of a kill -9 on postgres