Tagged Questions
1
vote
1answer
32 views
Mysql: Schema/Query Performance Approach for aggregated mailbox folders
I am about to code a messaging system where users can write messages to other users. User can create custom inbox folders for sorting the messages they receive, however, every user has 2 main inboxes: ...
1
vote
1answer
50 views
Group activities in activity feed by users and products
On my website I'm building an activity feed where I got the basics done and are now making some improvements here and there.
One of them is the grouping. I've built it so that if multiple users buys ...
1
vote
1answer
211 views
ORDER BY on aggregate field on a closure table giving unexpected results
I am updating my companies product database and I'm looking into different ways to do design our faceted navigation "selector" tables. The idea of faceted navigation might look like this:
It's ...
1
vote
2answers
394 views
How do I create a user-defined aggregate function?
I need an aggregate function that MySQL doesn't provide.
I would like it to be in MySQL's flavor of SQL (that is, not in C).
How do I do this? What I'm stuck on is creating an aggregate function -- ...
2
votes
1answer
218 views
Calculate percentage of false records to total records within a aggregate function
I'm looking for a solution to calculate a percentage rate of a boolean value:
Model:
Products 1 <-> n Components
Components.essential is a boolean attribute
What I want to calculate ...
4
votes
2answers
193 views
MySQL aggregate anomaly
I was checking selectivity of some columns for an index.
Where is this "ignore what I give you" behaviour documented?
This gives 4,851,908, 4,841,060, and 1,000,052
SELECT
COUNT(*),
...
4
votes
2answers
396 views
Is it a good idea to split MySQL DB into two servers
I have a MySQL DB server that accepts a lot of mobile application data for analysis. I would like to know if for optimization reasons the following architecture makes sense and is appropriate:
I ...
37
votes
4answers
2k views
Storing vs calculating aggregate values
Are there any guidelines or rules of thumb to determine when to store aggregate values and when to calculate them on the fly?
For example, suppose I have widgets which users can rate (see schema ...