query performance

From: pepone(dot)onrez <pepone(dot)onrez(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: query performance
Date: 2008-01-14 02:58:41
Message-ID: 198501d60801131858n529b46dcmeb286cda32d56e93@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I have this query in a table with 150 thowsand tuples and it takes to long

t_documentcontent._id AS _id
FROM t_documentcontent LIMIT 50 OFFSET 80000

here is the explain output

"Limit (cost=100058762.30..100058799.02 rows=50 width=58) (actual time=
19433.474..19433.680 rows=50 loops=1)"
" -> Seq Scan on t_documentcontent
(cost=100000000.00..100110772.07rows=150807 width=58) (actual time=
53.934..19402.030 rows=80050 loops=1)"
"Total runtime: 19433.748 ms"

here the table structure

CREATE TABLE t_documentcontent(
_id varchar(60) NOT NULL,
_filesystem varchar(60) NOT NULL,
_parent varchar(60) NOT NULL,
_document varchar(60) NOT NULL,
_title varchar NOT NULL,
_resume varchar,
_content varchar,
_lang integer NOT NULL,
_creationdate timestamp NOT NULL DEFAULT now(),
_updatedate timestamp NOT NULL DEFAULT now(),
_indexeddate timestamp NOT NULL DEFAULT now(),
CONSTRAINT documentcontent_pkey PRIMARY KEY (_id),
CONSTRAINT documentcontent_filesystem_fkey
FOREIGN KEY (_filesystem) REFERENCES t_filesystem(_id) ON UPDATE
CASCADE ON DELETE NO ACTION,
CONSTRAINT documentcontent_parent_fkey FOREIGN KEY (_parent) REFERENCES
t_node(_id) ON DELETE NO ACTION,
CONSTRAINT documentcontent_document_fkey
FOREIGN KEY (_document) REFERENCES t_node(_id) ON UPDATE CASCADE ON
DELETE NO ACTION,
CONSTRAINT documentcontent_lang_lang_fkey FOREIGN KEY (_lang) REFERENCES
t_lang(_id)) WITHOUT OIDS;

Any ideas for improve this query performance.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alex Turner 2008-01-14 03:30:46 Re: query performance
Previous Message Tom Lane 2008-01-14 02:00:09 Re: What pg_restore does to a non-empty target database