[Babase] Re: query from Marie

Karl O. Pinc kop at meme.com
Thu May 10 16:12:57 EDT 2007


On 05/10/2007 03:02:03 PM, Lacey Maryott wrote:
> Hello again,
>  we tried these queries, and they were returning every line for the  
> cids.... soo we tried to do count(distinct(cycpoints.cid)) and tried  
> adding in "order by members.grp, members.date"... however it still  
> seems to be taking a VERY long time in postgres before it switches to  
> apache and loads into the browser.  right now, the query, with the  
> addition of distinct and order by has been running in postgres 5  
> minutes.  IT isn't terribly long, just long enough to be a kind of a  
> pain. Does anyone else have any suggestions for what might work?

I don't think the order by is going to be useful because
it complains that you're not grouping by date, and you don't
want to.

I think the answer is for me to add indexes by month and year
to the db for MEMBERS.  Although really we probably don't want separate
month and year indexes, we probably want a combined year-month
index.  ....  It turns out this is the rnkdate.  ....
I think I don't want to think about this right now and make
progress on other stuff.  Can this be added to the todo
list?

We probably will be doing more queries like this, with
totals for month and year, right?

Karl <kop at meme.com>
Free Software:  "You don't pay back, you pay forward."
                  -- Robert A. Heinlein



More information about the Babase mailing list