Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux