MySQL Forums :: Performance :: Millions of rows, storing aggregate/rollup results help please


Advanced Search

Millions of rows, storing aggregate/rollup results help please
Posted by: Jacqueline Jacobin ()
Date: August 28, 2016 12:23PM

Hello,

I'm an MYSQL not-quite-newb but getting the hang of having big data. I have a table with a few million rows, with about 8 columns. I need to select count() across any combination of these columns, and I need to do it fast, for use with AJAX on a frontend.

Since running a basic SELECT is becoming expensive when I have been thinking of something like an aggregate table - which somebody posted about here - http://forums.mysql.com/read.php?32,590663,590663. But given that I have 8 columns, and each of these columns has at least 3 (in some cases 6) potential values, I'm looking at a LOT of possibilities (something like 400,000). Should I run some kind of aggregate code that loops iteratively through every single possible combination and store that total in the aggregate/rollup table, or is there a better way to do this? Any help, including code and/or pointers to other pages would be tremendously appreciated.

BTW I am using this with PHP but this seemed like the best specialized sub-forum to post this so apologies if it should be put elsewhere

Options: ReplyQuote


Subject Views Written By Posted
Millions of rows, storing aggregate/rollup results help please 550 Jacqueline Jacobin 08/28/2016 12:23PM
Re: Millions of rows, storing aggregate/rollup results help please 371 Rick James 08/30/2016 02:47PM
Re: Millions of rows, storing aggregate/rollup results help please 286 Jacqueline Jacobin 08/31/2016 07:03AM
Re: Millions of rows, storing aggregate/rollup results help please 273 Rick James 09/01/2016 04:35PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.