[GENERAL] How can I know whether an index already exists

2010-06-22 Thread kaifeng.zhu
Hi there, How can I know whether an index already exists? I have googled for hours and cannot found the solution... Any response are appreciated. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-ge

[GENERAL] Bad query performance with more conditions?

2010-06-24 Thread kaifeng.zhu
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

Fwd: [GENERAL] Bad query performance with more conditions?

2010-06-24 Thread kaifeng.zhu
On Thu, Jun 24, 2010 at 16:57, Thom Brown wrote: > Sounds like the planner took a wrong turn in the 2nd case.  Which > version of PostgreSQL are you running? PostgreSQL version 8.1.21 (With schemas) The explain commands show that: db1=> explain select * from emails where email_msg_id = '4dba

Re: [GENERAL] Bad query performance with more conditions?

2010-06-24 Thread kaifeng.zhu
On Thu, Jun 24, 2010 at 17:14, Alban Hertroys wrote: > > You didn't provide explain analyse results for those queries, so I'm just > guessing here, but I think you should add indices to email_msg_id and > email_sender_text to speed up those queries. > > Actually, from your results it would appea