Re: Huge Data - Mailing list pgsql-general

From Shridhar Daithankar
Subject Re: Huge Data
Date
Msg-id 200401141837.07629.shridhar_daithankar@myrealbox.com
Whole thread Raw
In response to Re: Huge Data  ("Matthew Lunnon" <mlunnon@rwa-net.co.uk>)
Responses Re: Huge Data
List 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


pgsql-general by date:

Previous
From: "Matthew Lunnon"
Date:
Subject: Re: Huge Data
Next
From: Együd Csaba
Date:
Subject: Re: Using regular expressions in LIKE