Re: [GENERAL] Query time is too long for netscape

From: Mark Jewiss <mark(at)knowledge(dot)com>
To: Chairudin Sentosa Harjo <chai(at)prima(dot)net(dot)id>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: [GENERAL] Query time is too long for netscape
Date: 2000-01-25 09:42:18
Message-ID: Pine.BSO.4.10.10001250938440.25942-100000@office.knowledge.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

On Tue, 25 Jan 2000, Chairudin Sentosa Harjo wrote:

> $sql = "select a.pin, b.first_name, b.last_name,
> start_time, duration,
> country_code, area_code, phone_number,
> a.service_type, total_units
> from tbs_billing_record a, ibs_subscriber b
> where a.pin=b.pin
> and date(start_time) between '$begindate' and '$enddate'
> and a.service_type='$service_type'
> order by $sortby1,$sortby2";

Ok, I've had a very quick look at this, and going on my past experiences,
I'd say that the problem is the query above. I've always had horribly slow
query returns when you are only pulling out rows with data between two
dates.

If you take the 'date between' line out of the query, how much quicker is
the result returned?

One way around this may be to create a temporary table that contains the
results of the query that you want. Your script query would then be
"select * from temptable".

You'd then need some sort of schedule so that the temp table is updated
every XX mins to suit your application - it comes down to working out how
important accurate information is to your customer.

Regards,

Mark.
--
Mark Jewiss
Knowledge Matters Limited
http://www.knowledge.com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message jean-charles savelli 2000-01-25 13:31:54 Multi lingual DB
Previous Message Chairudin Sentosa Harjo 2000-01-25 09:11:38 Re: [GENERAL] Query time is too long for netscape