From: | Chairudin Sentosa Harjo <chai(at)prima(dot)net(dot)id> |
---|---|
To: | Mark Jewiss <mark(at)knowledge(dot)com> |
Cc: | pgsql-general <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: [GENERAL] Query time is too long for netscape |
Date: | 2000-01-26 06:59:35 |
Message-ID: | 388E9B57.40EFE74A@prima.net.id |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Mark Jewiss wrote:
>
> 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.
That's what I am doing now, however I only put one month data to
the temporary table. The problem is when two months data is needed,
I have to create another temporary table, and change my script again.
I may have to find a way to tell netscape not to timeout too quickly.
Do you have other suggestions?
Thanks
Regards,
Chai
From | Date | Subject | |
---|---|---|---|
Next Message | Chairudin Sentosa Harjo | 2000-01-26 07:12:43 | Re: [GENERAL] Query time is too long for netscape |
Previous Message | Adriaan Joubert | 2000-01-26 06:37:50 | Re: [GENERAL] Re: server hardware recommendations |