Re: [GENERAL] count and limit

2006-08-19 Thread Fabio Victora Hecht
Ok, so I think the best that can be done is to EXPLAIN the query and check if it's gonna take long. If it is, I could use the estimated count. Thanks, FabioOn 8/17/06, Chris <[EMAIL PROTECTED]> wrote: Michael Fuhr wrote:> On Fri, Aug 18, 2006 at 10:34:44AM +1000, Chris wrote:>> Fabio Victora Hech

Re: [GENERAL] count and limit

2006-08-17 Thread Chris
Michael Fuhr wrote: On Fri, Aug 18, 2006 at 10:34:44AM +1000, Chris wrote: Fabio Victora Hecht wrote: I was wondering if there's a way to count the results of a query and return part of the result set it in one query (LIMIT). Because I usually have to count the results using one query (to tell

Re: [GENERAL] count and limit

2006-08-17 Thread Chris
Tom Lane wrote: Chris <[EMAIL PROTECTED]> writes: Fabio Victora Hecht wrote: I was wondering if there's a way to count the results of a query and return part of the result set it in one query (LIMIT). I was going to suggest a cursor but I don't think you can get the number of results a curso

Re: [GENERAL] count and limit

2006-08-17 Thread Michael Fuhr
On Fri, Aug 18, 2006 at 10:34:44AM +1000, Chris wrote: > Fabio Victora Hecht wrote: > >I was wondering if there's a way to count the results of a query and > >return part of the result set it in one query (LIMIT). Because I usually > >have to count the results using one query (to tell the user ho

Re: [GENERAL] count and limit

2006-08-17 Thread Tom Lane
Chris <[EMAIL PROTECTED]> writes: > Fabio Victora Hecht wrote: >> I was wondering if there's a way to count the results of a query and >> return part of the result set it in one query (LIMIT). > I was going to suggest a cursor but I don't think you can get the number > of results a cursor has :(

Re: [GENERAL] count and limit

2006-08-17 Thread Chris
Fabio Victora Hecht wrote: Hi! I've been using Postgresql for a while now and I'm very satisfied. I was wondering if there's a way to count the results of a query and return part of the result set it in one query (LIMIT). Because I usually have to count the results using one query (to tell th

[GENERAL] count and limit

2006-08-17 Thread Fabio Victora Hecht
Hi!I've been using Postgresql for a while now and I'm very satisfied.I was wondering if there's a way to count the results of a query and return part of the result set it in one query (LIMIT). Because I usually have to count the results using one query (to tell the user how many records match the c