Query

From: Vida Luz Arista <vlal(at)ideay(dot)net(dot)ni>
To: pgsql-admin(at)postgresql(dot)org
Subject: Query
Date: 2001-08-24 14:54:24
Message-ID: Pine.LNX.4.21.0108240843480.22004-100000@ideay.net.ni
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi All, I have two questions

1- I have a query but this is very slow, I need to acelerate the
consult, this result sill be show in the web.

My query is:

select user, descripcion from client where login not in (select
distinct(usr_cliente) from conexion where fecha between '$date_begin' and
'$date_end') order by user"

How can I to acelerate this consult?

2- I made this function:

CREATE FUNCTION list(date,date) RETURNS user
AS 'select distinct(usr_cliente) from conexion where fecha between
$date_begin and $date_end' LANGUAGE 'sql';

When I execute a query to this function like:
select select listado('08-10-2001', '08-13-2001') as user;

the result is just 1 row, however If I to execute the query this return
300 rows, why the function only return one row?

Thanks in advanced,

Regards,

In response to

Responses

  • Re: Query at 2001-08-24 15:59:32 from Richard Bayet
  • Re: Query at 2001-08-24 16:09:55 from Stephan Szabo

Browse pgsql-admin by date

  From Date Subject
Next Message Richard Bayet 2001-08-24 15:59:32 Re: Query
Previous Message Tom Lane 2001-08-24 13:39:39 Re: VACUUM problems