Hi Mike!

Cool, that you could solve the issue so fast.
I will have a look and install the new code with MySQL later this
evening (EET :-) ). 

I would suggest a solution, where it is possible to disable the whole
answer counting with a setting in TurbineResources.properties.
Reasons:
- performance (in case of lots of questions)
- avoiding confusion, if (0) is shown, in case db doesn't support either
  of the implemented solutions.

For performance issues it might also be a good idea to make a
possibility to define the database (or the supportance such as UNION,
OUTER JOIN, ...) in the TurbineResources.properties. Maybe a check if
the existing db-definitions in TurbineResources.properties could be
reused here

This statements are based on your email; I haven't had a look on the
source code yet.

Have fun!

 Bernie


On Thu, 9 Nov 2000, Mike Haberman wrote:

> 
> Hello All,
> 
>     I just commited a patch for DisplayTopics.java.   
> 
>     The whole problem is getting the number of answers for
>     each question.
> 
>     The solution in postgres is to use union selects
>     The solution in mysql is to use left outer joins
>     The default solution would be then to select count(*) from
>     answers where answer.question_id = x (looping over all relevant questions)
> 
>     The patch tries the first one, then the second one, then
>     finally it just returns 0 for each.  I did not implement
>     the last one.  Hopefully, the first two will cover most.
> 
>     The union select statement is SQL92. The left outer join stuff
>     has sql specific syntax for mysql.
> 
>     If someone REALLY REALLY REALLY wants the third one to work as well,
>     I can do it.
> 
> 
>     The good news is that even if your dbase doesn't support either
>     of sql syntax, jyve won't be throwing exceptions at you. 
> 
> 
>     One note:  I haven't tested this under mysql!  (I just copied
>     the old code).  
> 
> 
>     mike
> 
> --
> --------------------------------------------------------------
> To subscribe:        [EMAIL PROTECTED]
> To unsubscribe:      [EMAIL PROTECTED]
> Archives and Other:  <http://java.apache.org/main/mail.html>
> Problems?:           [EMAIL PROTECTED]
> 
> 


--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Archives and Other:  <http://java.apache.org/main/mail.html>
Problems?:           [EMAIL PROTECTED]

Reply via email to