Re: [GENERAL] Query time is too long for netscape
От | Mark Jewiss |
---|---|
Тема | Re: [GENERAL] Query time is too long for netscape |
Дата | |
Msg-id | Pine.BSO.4.10.10001250938440.25942-100000@office.knowledge.com обсуждение исходный текст |
Ответ на | Re: [GENERAL] Query time is too long for netscape (Chairudin Sentosa Harjo <chai@prima.net.id>) |
Список | 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
В списке pgsql-general по дате отправления: