Search Postgresql Archives

Bad query performance with more conditions?

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

 



Hi All,

I have a table named emails which created by following script:
create table emails (
    email_id bigserial primary key,
    email_msg_id char(36) not null,
    email_sender text not null)

The table has more than 10 million of records and I have already
created indexes on email_msg_id and email_sender

Following script finished very quickly (less than 1 seconds):
    select * from emails where email_msg_id =
'4dba381b-f55e-02d3-4b4a-95e2e98178e2' limit 1
But a similar script cost more than ten seconds:
    select * from emails where email_msg_id =
'4dba381b-f55e-02d3-4b4a-95e2e98178e2' and email_sender_text =
'sender@xxxxxxxxxx' limit 1

Both those scripts returns 0 rows of records indeed.

Any comment are highly appreciated.

-- 
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