« first day (507 days earlier)      last day (1595 days later) » 

12:19 PM
0
Q: Query to find top prolific questioners by tag

Przemyslaw ReminI would like to get the list of questioners who asked the most questions per tag. Can you please advise me how to write such a query? I do not care about the reputation of questioners, I care about the quantity of questions they ask.

 
 
1 hour later…
1:32 PM
@Martin I've forked your tag answers query here. I joined posttags and tags which due to the business rules no longer need a posttypeid in the where. And I used owneruserid directly instead of the extra join with users.
That does have the caveat that it now groups on null values for those answers where the user has left the site. You win some you lose some. Fixable with a where ...
 
2:37 PM
You're right - I was doing a completely unnecessary join there. I have edited both queries to avoid this: data.stackexchange.com/meta.stackexchange/query/1168757/… and data.stackexchange.com/meta.stackexchange/query/1168759/…
Probably I could have also omitted the condition on PostTypeId - since ParentId will be NULL if it is not an answer....? (I am not sure whether this makes much of difference.)
The advantage of join with PostTags is that I can simply use = ##tagName## instead of LIKE '%<##tagName##>%'?
 
@Martin yes, but you have to be careful there as wiki and excerpts and election nominations also lack a parentid. But they don't have tags so in this case it won't matter so you'll be good with that assumption.
@Martin yes. And that has the additional benefit that it will use the index on the tags table. a where clause with Like '%something% will always give you a full table scan.
 
The problem with users who left the site can be avoided if I use GROUP BY a.OwnerUserId, a.OwnerDisplayName, right?
 
yeah, that could work
but owneruserid is indexed so a where isn't that expensive
 
I have edited both queries I linked in the answer: I left out the unnecessary join with Users. And I have added OwnerDisplayName to GROUP BY clause.
 
Nice!
 
2:48 PM
I have taken your query and added also non-CW version: data.stackexchange.com/meta.stackexchange/query/1168816/…
If that's ok, I will add also links to your queries into the answer. (And I will include link to this chat - for more detailed explanation.)
A couple of more answers to beat Tim Stone. Getting that score might be the hardest part. — rene 2 hours ago
So maybe I should have let you answer the question. :-)
Or maybe do you want to post another answer with the explanation why using join with PostTags si better?
 
No, it is fine. I assume you appreciate my feedback. I don't need the rep.
 
In any case, this it true for both - query for askers and query for answerers.
I'll be better of if I use PostTags rather then my original version with Tags LIKE '%<##tagName##>.
So I should try to change it in the query for askers, too.
 
3:04 PM
I tend to look at the execution plan to see if I expect any gains. Reducing/removing Index scans is generally an improvement. On small db's you probably won't notice. For the stackoverflow database it does matter, specially if you're hitting posts(withdeleted)
 
I have often used SEDE when searching for something in a specific tag. And I have always used Tags LIKE '%<##tagName##>. I'll try to use the PostTags table in the future.
I have edited the post. (It now explicitly mentions the SEDE chatroom - which probably counts as advertising this room. So at least form this POV it was useful.)
Still, sometimes I am searching in PostsWithDeleted. In such cases I cannot use PostTags. (I suppose that the PostTags table does not contain the posts that were deleted.)
There were some posts on meta about this (I vaguely recalled that I've seen them before): PostTags does not include deleted questions and May I ask for the tag information of the deleted posts in the SEDE?.
 
0
Q: Data Explorer: time series

opisthofulaxI would like to know the reputation score from a certain user from sometimes ago, is there the possibility of recovering data from past with the SQL language?

 
3:22 PM
@Feeds This one was closed as a duplicate of: Determining user's reputation as of particular date?
 
4:19 PM
@Martin yeah, that is indeed a problem. I understand they sanitize tables and I'm happy they introduced PostsWithDeleted. Do note that the tags field was added later as a field to be NOT sanitized. In the initial introduction Tags was null in Postswithdeleted ...
 

« first day (507 days earlier)      last day (1595 days later) »