Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

Sort by 'Views' please?!

Quote Reply
Sort by 'Views' please?!
Hi

Would it be possible to be able to sort by 'views' in any upcoming version? You can sort posts by 'replies' and 'date' etc. but not by views. I don't understand why this hasn't been implemented?

Cheers

- wil
Quote Reply
Re: [Wil] Sort by 'Views' please?! In reply to
Post views (and thread views) are not stored in the Post table. Because of that, an index cannot be used and so the resulting query would be extremely slow. We had to move the post/thread views to a seperate table for a major speedup - every time someone viewed a post, it had to update the table. If someone also tried a search, things could get backed up and clog up the server, since MySQL locks the entire table to update a row. Postgresql wouldn't have this problem because it does support locking out just a row instead of the whole table. However, most people (including us) are not running postgresql, so the optimization remains.

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [jagerman] Sort by 'Views' please?! In reply to
Thanks for the clarification. I can see, understand and support the logic behind your decision.

Does the next release of MySQL have any plans of such a feature?

- wil
Quote Reply
Re: [Wil] Sort by 'Views' please?! In reply to
>> Does the next release of MySQL have any plans of such a feature?<<

I don't think Jason would re-write the code even it it did.

A lot of people wouldn't upgrade mysql either.
Quote Reply
Re: [PaulW] Sort by 'Views' please?! In reply to
I think you'll find that most major web hosts will upgrade once a stable version is released. Offering a database is as mandantory these days as having Perl or PHP installed IMO, and a lot of hosts, in fact I think all hosts strive to keep on top of things re latest software on their servers.

I Can't wait for Perl 6 to be released. That will make things a lot more interesting. It is poised to be more of a web-friendly language, hoping to regain lost ground on PHP.

I think you'll find that web hosts will upgrade as soon as a stable version is released. Or at least run parallel installations.

And if they don't bother -- do you really want to host your site with them anyway?!! I'd move my site if my host didn't upgrade to the latest MySQL release or the latest perl release, Apache or any other cutting edge technology for that matter.

- wil

Last edited by:

Wil: Nov 29, 2001, 4:45 AM
Quote Reply
Re: [jagerman] Sort by 'Views' please?! In reply to
So what databases does the GForum support? What databases will the GTCommunity support?

- wil
Quote Reply
Re: [Wil] Sort by 'Views' please?! In reply to
I've worked on lots of servers that are using older versions of perl and mysql. I think some hosts feel it is more of an arse to re-compile and upgrade than leave it alone.

Obviously _some_ upgrade but I don't think it is worth re-writing the code of Gossamer Forum just for the sake of being able to view post by "views".

Those who don't upgrade are then eliminated from purchasing Gossamer-Forum.....you mustn't have a business mind Tongue

Last edited by:

PaulW: Nov 29, 2001, 4:50 AM
Quote Reply
Re: [Wil] Sort by 'Views' please?! In reply to
>>So what databases does the GForum support? What databases will the GTCommunity support?
<<

Why don't you look in GT/SQL/Driver Laugh
Quote Reply
Re: [PaulW] Sort by 'Views' please?! In reply to
Because I've deleted my copy until I'm ready to purchase, which isn't yet. I'm holding out for the Community plugin/product/script(?).

- wil
Quote Reply
Re: [Wil] Sort by 'Views' please?! In reply to
MYSQL/ODBC/POSTGRES/ORACLE

Last edited by:

PaulW: Nov 29, 2001, 4:57 AM
Quote Reply
Re: [PaulW] Sort by 'Views' please?! In reply to
Well if you read the boards you will see that a common requsted feature is the ability to see the "Hot Threads" or the "Most Active Threads" etc.

So what you're saying is that GT will never implement this and thus denying people this feature? Now in my mind that is not good business sense.

Just look around, go and have a look at other boards. People see that hot threads, most viewed topics, forum statistics link everywhere and they have come to expect it.

Maybe this would be possible to implement as a stand alone page, and not as part of the forum itself. This wouldn't slow down the message list window but still make the feature available for those who would want it?

How is VBulleting able to do this?


- wil
Quote Reply
Re: [PaulW] Sort by 'Views' please?! In reply to
In Reply To:
MYSQL/ODBC/POSTGRES/ORACLE

Great. Should be easy enough to add as a hack then. :-)

- wil

Last edited by:

Wil: Nov 29, 2001, 4:58 AM
Quote Reply
Re: [Wil] Sort by 'Views' please?! In reply to
>>So what you're saying is that GT will never implement this and thus denying people this feature?<<

You have a great talent for putting words in my mouth that I never said Crazy
Quote Reply
Re: [PaulW] Sort by 'Views' please?! In reply to
Argh. I'm not in the mood for arguing with you. If I stopped wasting my time arguing with you I could get a lot more work done around here.

I'm off to lunch.

- wil
Quote Reply
Re: [Wil] Sort by 'Views' please?! In reply to
Hey I'm not arguing. You asked what drivers are supported, I answered, you asked about sorting by views, I gave my opinion, and then you claimed I said GT would _never_ implement the changes which I never said.

Whether it is done or not is up to Jason/Alex not me, I was just giving my opinion.

I find it quite funny....I'm just winding you up the whole time....it's banter. You take me too seriously.

As I said to Eliot the other day, if I was arguing or mad I'd use CAPITALS or Mad Mad

Last edited by:

PaulW: Nov 29, 2001, 5:22 AM
Quote Reply
Re: [PaulW] Sort by 'Views' please?! In reply to
OK.
Quote Reply
Re: [Wil] Sort by 'Views' please?! In reply to
It's possible to do, but it is just very slow.

Currently, the query looks something like:

select * from Post left join User on Post.user_id_fk = User.user_id
order by xxx ASC|DESC
limit nn (typically 25)

GT::SQL currently can't handle the needed view query, which would be something along the lines of:

select * from Post left join User on Post.user_id_fk = User.user_id, PostView
where post_id_fk = post_id
order by post_thread_views ASC|DESC
limit nn

GT::SQL doesn't handle combining a left join with a normal join, plus the query itself is going to be quite a bit slower than the other ones.

Testing out the queries manually, selecting the top 25 sorted by views takes about 1.5 seconds on my system, compared to <0.2 seconds to select the 25 most recent.

BTW, Rumour has is that MySQL will have row-level locking in the upcoming version 4.0.

Also, expecting hosting clients to upgrade is wishful thinking. There are still a large number of servers out there still running Perl 5.004_04. For a little history lesson, 5.004_05 was released October 15, 1997. 5.005 was release July 22, 1998 (shortly followed by 5.005_01 5 days later).

Though I share your Perl 6 sentiment, judging from current trends it will be at least 3 years after its release until we could even consider writing Perl 6-specific code. A real shame :(

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [jagerman] Sort by 'Views' please?! In reply to
Thanks for the informative reply.

I must say I am excited to see the latest release of MySQL 4. If the rumous hold, it should prove to a be a vast improvment on the current standard.

The Perl 6 developers are trying their hardest to make sure any code written on version 5.x will work under 6. The same as they did when 5 was released with upgrading code from 4, but you are stumped if you're writing to take advantage of new features in 6 only.

Ah well. Maybe you can make your development version available to a handful of us? :-)

- wil

Last edited by:

Wil: Nov 30, 2001, 2:11 AM
Quote Reply
Re: [Wil] Sort by 'Views' please?! In reply to
In Reply To:
Ah well. Maybe you can make your development version available to a handful of us? :-)

Well, even if I did, it would only be good for a few hours since it is constantly changing. We should have 1.0.1 available for download on Tuesday or Wednesday. It will include a UBB import scripts, and has fixed all of the reported bugs (and a few that weren't).

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [Jagerman] Sort by 'Views' please?! In reply to
I don't really get it, what & when do you plan to implement.
I understand, that sort by Views is not effective, and would slow down the GForum.
Ok. I understand that.

But Wil's idea to have a separate page like "Hot Threads" or the "Most Active Threads", etc, is a good idea, and if you generate it statically e.g. on a daily basis, then there will be no any performance problems. Both should display the top 100 threads (100 or more, would be required for a such big forum like GT forum).

I think, there is need for such feature(s), and it is reasonable to implement.
So when do you plan to implement such feature(s)?
Planned only for v2.0, or may be possible in an earlier release?

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
Quote Reply
Re: [webmaster33] Sort by 'Views' please?! In reply to
In my opinion a "Hot Threads" type feature would be better served as a plugin rather than a core feature.
Quote Reply
Re: [Paul] Sort by 'Views' please?! In reply to
Why? What difference does it make?

- wil
Quote Reply
Re: [Paul] Sort by 'Views' please?! In reply to
Why plugin?
Ok to have it optional, but why to make GForum worser, than other forums? They do not have their features as plugin...

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
Quote Reply
Re: [webmaster33] Sort by 'Views' please?! In reply to
I've added this to the list of things to consider for version 2.

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com