query on large tables - Mailing list pgsql-general

From Peter Pilsl
Subject query on large tables
Date
Msg-id 20010902001947.A86425@i3.atat.at
Whole thread Raw
List pgsql-general
I've a query on a large table. The table consists of approx. 100.000
entries and the where-clause checks 4 chars against a 100-char-text in
the table. So this is hard work and the query takes about 4 seconds on
my system. This is quite ok, but the problem is, I want to prepare the
result for human readers and therefore split in several pages.  So I
first need to query once to get the number of results and based on
this number I create a navigation-bar and construct a limit-operator.
With this limit-operator I query a second time to get and display the
entries.

In fact I ask postgres the same query two times (difference is only
the limit-section) and this takes 8 instead of 4 seconds.

Any way to do better ?


thnx,
peter


--
mag. peter pilsl

phone: +43 676 3574035
fax  : +43 676 3546512
email: pilsl@goldfisch.at
sms  : pilsl@max.mail.at

pgp-key available

pgsql-general by date:

Previous
From: "booli2"
Date:
Subject: About system tables
Next
From: Gunnar Rønning
Date:
Subject: Re: PL/java?