Re: Please suggest me on my table design (indexes!)

From: "DaNieL(dot)(dot)!" <daniele(dot)pignedoli(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Please suggest me on my table design (indexes!)
Date: 2009-06-23 07:51:49
Message-ID: 29222241-5e20-463a-b07b-fcbaf917d3db@k38g2000yqh.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Almost forgot: one fo the heavier select query can be:
-----
SELECT
contact.id,
contact.company_id,
contact.name AS nome,
contact.surname AS cognome,
contact.email AS email,
contact.company_name AS azienda
FROM
contact
WHERE
(
lower(contact.company_name) LIKE 'smit%' OR
lower(contact.name) LIKE 'smit%' OR
lower(contact.surname) LIKE 'smit%' OR
contact.phone LIKE 'smit%' OR
lower(contact.code) LIKE 'smit%' OR
lower(contact.email) LIKE 'smit%'
)
ORDER BY
contact.company_name ASC, contact.company_id DESC
-----
And this is the queyr plain: http://explain.depesz.com/s/Il

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Grzegorz Jaśkiewicz 2009-06-23 07:55:27 Re: Why my queryes doesnt not use indexes?
Previous Message DaNieL 2009-06-23 07:47:15 Please suggest me on my table design (indexes!)