Re: Huge Data - Mailing list pgsql-general

From Richard Huxton
Subject Re: Huge Data
Date
Msg-id 200401141318.45658.dev@archonet.com
Whole thread Raw
In response to Re: Huge Data  (Sezai YILMAZ <sezai.yilmaz@pro-g.com.tr>)
List pgsql-general
On Wednesday 14 January 2004 12:39, Sezai YILMAZ wrote:
>
> select logid, agentid, logbody from log where logid=3000000;

At a guess, because logid is bigint, whereas 300000 is taken to be integer.
Try ... where logid = 300000::bigint;

This is in the FAQ too I think, and is certainly in the archives.

Other things you might come across:
SELECT max() involves a sequential scan just like count(), you can rewrite it
as SELECT target_column FROM my_table ORDER BY target_column DESC LIMIT 1

The config values are very conservative. You will definitely want to tune them
for performance. See the articles here for a good introduction:
  http://www.varlena.com/varlena/GeneralBits/Tidbits/index.php

The VACUUM command is used to reclaim unused space, and the ANALYZE command to
regenerate statistics. It's worth reading up on both.

You can use EXPLAIN ANALYSE <query here> to see the plan that PG uses. I think
there's a discussion of it at http://techdocs.postgresql.org/

--
  Richard Huxton
  Archonet Ltd

pgsql-general by date:

Previous
From: Együd Csaba
Date:
Subject: Re: Using regular expressions in LIKE
Next
From: Richard Huxton
Date:
Subject: Re: Huge Data