Re: Huge Data

From: Shridhar Daithankar <shridhar_daithankar(at)myrealbox(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Huge Data
Date: 2004-01-14 13:07:07
Message-ID: 200401141837.07629.shridhar_daithankar@myrealbox.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wednesday 14 January 2004 18:22, Matthew Lunnon wrote:
> select logid, agentid, logbody from log where logid=3000000;
>
> this query also returns after about 120 seconds. The table log has about
> 7 million records, and logid is the primary key of log table. What about
> that? Why is it too slow?

How about

select logid, agentid, logbody from log where logid='3000000';

or

select logid, agentid, logbody from log where logid=3000000::int4;

Basically you need to typecast the constant. Then it would use the index.

I am not sure of first form of it though. I recommend you use the later form.

Shridhar

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Együd Csaba 2004-01-14 13:16:25 Re: Using regular expressions in LIKE
Previous Message Shridhar Daithankar 2004-01-14 13:02:45 Re: Huge Data