[MDEV-6019] Creating CONNECT PIVOT table on large base table crashes server Created: 2014-04-03 Updated: 2014-04-04 Resolved: 2014-04-04 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 10.0.10 |
| Fix Version/s: | 10.0.11 |
| Type: | Bug | Priority: | Major |
| Reporter: | Kolbe Kegel (Inactive) | Assignee: | Olivier Bertrand |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | connect-engine | ||
| Environment: |
Mac OS X, CentOS 6.5 |
||
| Description |
|
I have a table with a couple million rows in it:
Each row of the table has different values in the character columns, but all three character columns are the same for each row:
I tried creating a really simple pivot table: create table big_table_pivot engine=connect table_type=pivot tabname=big_table; Shortly after executing that create table statement, mysqld crashes:
It crashes even after removing quite a lot of rows. Now with <200,000 rows in the table, the CREATE TABLE statement appears to be hanging, rather than crashing. |
| Comments |
| Comment by Olivier Bertrand [ 2014-04-04 ] |
|
Well, PIVOT is probably not meant to be used on very big tables. It requires a lot of storage to find the distinct PIVOT column names and, if there are many, can produce tables with too many columns. |
| Comment by Kolbe Kegel (Inactive) [ 2014-04-04 ] |
|
I thought it was maybe some problem with memory usage, but it didn't seem like mysqld memory usage really went up that much. I had success using my own hand-rolled "pivot" approach for this large table where I did GROUP BY and GROUP_CONCAT(IF(pivotCol=1,factCol,null)) as value_1, repeating that pattern for each value of the pivot column. I was hoping I could use the pivot feature in connect to do that heavy lifting for me. I'm still sort of figuring out how pivot in connect works, so maybe I can get it to do what I want if I keep poking at it enough |
| Comment by Olivier Bertrand [ 2014-04-04 ] |
|
Ooops, I did not quite understand what you did... |