Joinutility seperatorLogin utility separator Infobright.com
   
1 of 2
1
How to optimize the Group by statement
Posted: 11 August 2009 09:06 AM   Ignore ]  
Newbie
Rank
Total Posts:  43
Joined  2009-08-11

In my db I have 300 M records(BRIGHTHOUSE engine).
When I try to run query with group by
e.g. “select field from tabl_name group by field”
I’m waiting 2 min before I receive the result.

Please tell me how to speed up queries with group by.
Thank you.

Profile
 
Posted: 11 August 2009 09:15 AM   Ignore ]   [ # 1 ]  
Sr. Member
Avatar
RankRankRankRank
Total Posts:  487
Joined  2008-08-18

Hello Agunko,

Please tell us more about the types of columns and about the select statement(s) that you are interested in.

We recently observed some performance drawbacks in 3.2 RC1. Your problems may be related to one of them.

Many thanks and best greetings,

Dominik

Signature 
Profile
 
Posted: 11 August 2009 03:47 PM   Ignore ]   [ # 2 ]  
Member
RankRankRank
Total Posts:  269
Joined  2008-12-03

Hi Dominik,

Do you have more information about those performance drawbacks ?
thanks
C_G

Profile
 
Posted: 11 August 2009 04:55 PM   Ignore ]   [ # 3 ]  
Sr. Member
Avatar
RankRankRankRank
Total Posts:  487
Joined  2008-08-18

Hello C_George,

Sure, let me give you a couple of examples.

Thanks to a great help from the community users, we were able to identify several drawbacks in 3.2 RC1, such as:

—count distinct (also with aggregations)
—aggregations on the joined data tables
—aggregations involving lookup columns
—aggregations on time-related columns
—....

Most of these things are already fixed and in the middle of testing. Performance of aggregations in the next 3.2 version will be more stable. However, there is no guarantee that the list of drawbacks is already complete. Therefore, I’m very interested in hearing more from Agunko and others.

Many thanks and best greetings,

Dominik

Signature 
Profile
 
Posted: 27 August 2009 02:19 PM   Ignore ]   [ # 4 ]  
Newbie
Rank
Total Posts:  14
Joined  2009-04-29

OK, today I tried a very large group by query under 3.2rc1, and the db box got very unresponsive, with huge amounts of IO wait.  At the point that we killed the query it had created over 200G of temp files in the /var/lib/mysql/etc/cache directory.  Does this sound like it could running into the known issue of 3.2rc1 with group by performance?

The data sets involved are very large.  One table is around 300 million rows, and the smaller is around 1.1 million rows.  The tables are being joined on integer columns.  I would estimate the result of the query should be approx 20,000 groups, with counts ranging from the many hundred million to the few thousand.  Still over 200G of temp files in the cache directory seemed excessive.

Here is the actual query:

select section,pos,count(section) scount from spoof_2_section s2s join oas_log ol on s2s.spoof_id = ol.spoof_id group by section,pos order by scount;

oas_log is the 300+ million row table, spoof_2_section is the 1.1 million row table.  The oas_log table contains the spoof (targeting string) and the pos (ad position) for each ad impression.  Each spoof can belong to one or more sections, and we need to roll up the results to the section, pos level.

[ Edited: 27 August 2009 02:24 PM by f300v10]
Profile
 
Posted: 28 August 2009 05:58 AM   Ignore ]   [ # 5 ]  
Sr. Member
Avatar
RankRankRankRank
Total Posts:  763
Joined  2008-08-18

Hi,

Is it possible to see bh.err log file for this query? The size of temporary files looks suspicious, indeed.
BTW, count(*) should be faster than count(column), and is nearly the same for this case.

Regards,

Signature 
Profile
 
Posted: 28 August 2009 09:07 AM   Ignore ]   [ # 6 ]  
Newbie
Rank
Total Posts:  14
Joined  2009-04-29
Jakub Wroblewski - 28 August 2009 05:58 AM

Hi,

Is it possible to see bh.err log file for this query? The size of temporary files looks suspicious, indeed.
BTW, count(*) should be faster than count(column), and is nearly the same for this case.

Regards,

Jakub, there was nothing in the bh.err file relevant to the query in question.  And thanks for the tip on count(*), wasn’t sure how ICE would react to that.  We have re-installed 3.1, and I will be running the same query against that once I have loaded the data.  I will post my results here once I have them.

Profile
 
Posted: 28 August 2009 09:16 AM   Ignore ]   [ # 7 ]  
Sr. Member
Avatar
RankRankRankRank
Total Posts:  763
Joined  2008-08-18

Hi,

f300v10 - 28 August 2009 09:07 AM

Jakub, there was nothing in the bh.err file relevant to the query in question.

Do you mean, no execution log for this query? Maybe you have not switched it on (“ControlMessages = 2” in brighthouse.ini file)? The log may be helpful, as e.g. all intermediate statistics are displayed there. We will see which part of query produces so large cache files.

Regards,

Signature 
Profile
 
Posted: 01 September 2009 10:09 AM   Ignore ]   [ # 8 ]  
Newbie
Rank
Total Posts:  14
Joined  2009-04-29

OK, I have some more information to share.  First, given the known group by issues of 3.2,, we rolled back to the previous version of ICE just in case 3.2 was causing the issues we have seen.  Also, we set ‘ControlMessages = 2’ to generate query plan data.  After re-loading the test data, I ran another series of test queries, with progressively larger data sets used.  Yesterday we again saw the problem where the cache data directory was filled up with over 200Gig of temp files created during query execution.  There appears to be a ‘tipping point’ in the data set size that triggers this massive creation of temp files.

First some more information on the data sets involved.  I realise we are dealing with very large data sets, and may be pushing the limits of what ICE can do.  But this is actual data, not test data, and the query involved is what is required by our business users.  There are two tables involved, described below:

First there is a mapping table, that relates the ad target string (spoof) to the available ad targeting areas (section).  I have created a ‘bucket’ column, to allow the queries to be split into smaller logical units without compromising the results,  This is the section_segment column.  Each section was assigned a value between 1 and 4, as we are running on a 4 core machine.  The table also contains an integer spoof_id column so that we did not have to join on a varchar to the data table.  The table is populated with 1129278 rows, with 1273 distinct values for section.

mysql> desc spoof_2_section;
+————————-+———————+———+——-+————-+———-+
| Field       | Type       | Null | Key | Default | Extra |
+————————-+———————+———+——-+————-+———-+
| spoof       | varchar(100) | YES |    | NULL   |    |
| spoof_id     | int(11)    | YES |    | NULL   |    |
| section       | varchar(32)  | YES |    | NULL   |    |
| section_segment | int(2)    | YES |    | NULL   |    |
+————————-+———————+———+——-+————-+———-+
4 rows in set (0.03 sec)

Here is the actual log data table.  It currently contains just over 1 billion rows.  The serve_datetime column is used to limit the values based on the date(s) we are trying to analyze.

mysql> desc oas_log;
+————————+———————+———+——-+————-+———-+
| Field       | Type       | Null | Key | Default | Extra |
+————————+———————+———+——-+————-+———-+
| serve_datetime | datetime   | YES |    | NULL   |    |
| rmid       | varchar(100) | YES |    | NULL   |    |
| site       | varchar(20)  | YES |    | NULL   |    |
| spoof       | varchar(100) | YES |    | NULL   |    |
| spoof_id     | int(11)    | YES |    | NULL   |    |
| campaign     | varchar(100) | YES |    | NULL   |    |
| creative     | varchar(100) | YES |    | NULL   |    |
| pos         | varchar(100) | YES |    | NULL   |    |
| country     | varchar(40)  | YES |    | NULL   |    |
| st         | varchar(40)  | YES |    | NULL   |    |
| msa         | varchar(20)  | YES |    | NULL   |    |
| dma         | smallint(6)  | YES |    | NULL   |    |
| city       | varchar(80)  | YES |    | NULL   |    |
| areacode     | varchar(20)  | YES |    | NULL   |    |
| zip         | varchar(20)  | YES |    | NULL   |    |
| rsi_kw       | smallint(6)  | YES |    | NULL   |    |
| age_kw       | smallint(6)  | YES |    | NULL   |    |
| gender_kw     | varchar(20)  | YES |    | NULL   |    |
| cobrand_kw   | varchar(40)  | YES |    | NULL   |    |
| vw_kw       | smallint(6)  | YES |    | NULL   |    |
| mode_kw     | varchar(40)  | YES |    | NULL   |    |
| decl_kw     | varchar(40)  | YES |    | NULL   |    |
| provider_kw   | varchar(40)  | YES |    | NULL   |    |
| cc_kw       | varchar(100) | YES |    | NULL   |    |
| ct_kw       | varchar(100) | YES |    | NULL   |    |
| cid_kw       | smallint(6)  | YES |    | NULL   |    |
| st_kw       | varchar(40)  | YES |    | NULL   |    |
| zip_kw       | varchar(50)  | YES |    | NULL   |    |
| dma_kw       | smallint(6)  | YES |    | NULL   |    |
| context_kw   | varchar(50)  | YES |    | NULL   |    |
| idtype_kw     | varchar(40)  | YES |    | NULL   |    |
| severe_kw     | varchar(40)  | YES |    | NULL   |    |
| pollen_kw     | tinyint(4)  | YES |    | NULL   |    |
| temp_kw     | tinyint(4)  | YES |    | NULL   |    |
| temp_h1_kw   | tinyint(4)  | YES |    | NULL   |    |
| temp_h2_kw   | tinyint(4)  | YES |    | NULL   |    |
| temp_h3_kw   | tinyint(4)  | YES |    | NULL   |    |
| temp_l1_kw   | tinyint(4)  | YES |    | NULL   |    |
| temp_l2_kw   | tinyint(4)  | YES |    | NULL   |    |
| temp_l3_kw   | tinyint(4)  | YES |    | NULL   |    |
| fcond_1_kw   | varchar(60)  | YES |    | NULL   |    |
| fcond_2_kw   | varchar(60)  | YES |    | NULL   |    |
| fcond_3_kw   | varchar(60)  | YES |    | NULL   |    |
+————————+———————+———+——-+————-+———-+
43 rows in set (0.19 sec)

I am running out of characters in this post, so it will continue in the next one.

Profile
 
Posted: 01 September 2009 10:24 AM   Ignore ]   [ # 9 ]  
Newbie
Rank
Total Posts:  14
Joined  2009-04-29

Here is an example of the queries we are running:

select section,pos,age_kw,gender_kw,count(*) scount from spoof_2_section s2s join oas_log ol on s2s.spoof_id = ol.spoof_id where ol.serve_datetime between ‘2009-08-24 00:00:00’ and ‘2009-08-26 23:59:59’ and s2s.section_segment = 3 group by section, pos order by scount;

There are just over 800 million rows in the oas_log table for the date range specified above.  The same query runs fine when the date range is limited to ‘2009-08-24 00:00:00’ and ‘2009-08-25 23:59:59’, which results in 500 million rows in the OAS log table.

I ran 4 copies of the above query simultaneously, with the section_segment limited to 1,2,3 and 4.  That allows all 4 cores on the db box to be utilized.  One of the queries ran to completion.  The other 3 exited when the cache disk was consumed.

Here is the relevant output found in the br.err file:

2009-08-31 21:44:10 [31] T:-1 = TABLE_ALIAS(T:0,“spoof_2_section”)
T:-2 = TMP_TABLE(T:-1)
T:-3 = TABLE_ALIAS(T:1,“oas_log”)
T:-2.JOIN(T:-3)
F:0 = CREATE_FILTER(T:-2,TERM(t:-3 a:0),BETWEEN,TERM(vt:2009-08-24 00:00:00),TERM(vt:2009-08-26 23:59:59),WHERE)
F:0 = AND(F:0,TERM(t:-1 a:3),=,TERM(vn:1),TERM(<null>))
F:0 = AND(F:0,TERM(t:-3 a:4),=,TERM(t:-1 a:1),TERM(<null>))
T:-2.FILTER(F:0)
A:-1 = T:-2.ADD_COLUMN(TERM(t:-1 a:2),GROUP_BY,“section”,“ALL”)
A:-2 = T:-2.ADD_COLUMN(TERM(t:-3 a:7),GROUP_BY,“pos”,“ALL”)
A:-3 = T:-2.ADD_COLUMN(TERM(<null>),COUNT,“scount”,“ALL”)
A:-4 = T:-2.ADD_COLUMN(TERM(<null>),COUNT,“null”,“ALL”)
T:-2.ADD_ORDER(A:-4,0)
RESULT(T:-2)

2009-08-31 21:44:10 [31] Initial execution plan (non-join):
2009-08-31 21:44:10 [31] Cnd(0):  t:-1 a:3 BET. vn:1 AND vn:1   (12.59)
2009-08-31 21:44:10 [31] Cnd(1):  t:-3 a:0 BET. vn:2.761900195e+16 AND vn:2.761905564e+16   (20.52)
2009-08-31 21:44:11 [31] Packs/packrows after KN evaluation:
2009-08-31 21:44:11 [31] (t0) Pckrows: 18, susp. 5 (13 empty 0 full). Packs opened in 1 cond.: 1
2009-08-31 21:44:11 [31] (t1) Pckrows: 16433, susp. 12709 (3724 empty 0 full). Packs opened in 1 cond.: 281
2009-08-31 21:44:11 [31] (t0-t1) Pack2Pack pairs: 21.48% possible.
2009-08-31 21:44:14 [31] Packrows after exact evaluation (WHERE):
2009-08-31 21:44:14 [31] (t0): 18 all packrows, 5 to open (including 4 full)
2009-08-31 21:44:14 [31] (t1): 16433 all packrows, 12709 to open (including 12428 full)
2009-08-31 21:44:14 [31] Join execution plan:
2009-08-31 21:44:14 [31] Cnd(2):  t:-3 a:4 = t:-1 a:1   (39.63)
2009-08-31 21:44:15 [31] Traversed all 312924 rows.
2009-08-31 21:45:06 [32] T:-1 = TABLE_ALIAS(T:0,“spoof_2_section”)
T:-2 = TMP_TABLE(T:-1)
T:-3 = TABLE_ALIAS(T:1,“oas_log”)
T:-2.JOIN(T:-3)
F:0 = CREATE_FILTER(T:-2,TERM(t:-3 a:0),BETWEEN,TERM(vt:2009-08-24 00:00:00),TERM(vt:2009-08-26 23:59:59),WHERE)
F:0 = AND(F:0,TERM(t:-1 a:3),=,TERM(vn:2),TERM(<null>))
F:0 = AND(F:0,TERM(t:-3 a:4),=,TERM(t:-1 a:1),TERM(<null>))
T:-2.FILTER(F:0)
A:-1 = T:-2.ADD_COLUMN(TERM(t:-1 a:2),GROUP_BY,“section”,“ALL”)
A:-2 = T:-2.ADD_COLUMN(TERM(t:-3 a:7),GROUP_BY,“pos”,“ALL”)
A:-3 = T:-2.ADD_COLUMN(TERM(<null>),COUNT,“scount”,“ALL”)
A:-4 = T:-2.ADD_COLUMN(TERM(<null>),COUNT,“null”,“ALL”)
T:-2.ADD_ORDER(A:-4,0)
RESULT(T:-2)

2009-08-31 21:45:06 [32] Initial execution plan (non-join):
2009-08-31 21:45:06 [32] Cnd(0):  t:-1 a:3 BET. vn:2 AND vn:2   (12.69)
2009-08-31 21:45:06 [32] Cnd(1):  t:-3 a:0 BET. vn:2.761900195e+16 AND vn:2.761905564e+16   (20.52)
2009-08-31 21:45:06 [32] Packs/packrows after KN evaluation:
2009-08-31 21:45:06 [32] (t0) Pckrows: 18, susp. 6 (12 empty 0 full). Packs opened in 1 cond.: 2
2009-08-31 21:45:06 [32] (t1) Pckrows: 16433, susp. 12709 (3724 empty 0 full). Packs opened in 1 cond.: 281
2009-08-31 21:45:06 [32] (t0-t1) Pack2Pack pairs: 25.77% possible.
2009-08-31 21:45:07 [32] Packrows after exact evaluation (WHERE):
2009-08-31 21:45:07 [32] (t0): 18 all packrows, 6 to open (including 4 full)
2009-08-31 21:45:07 [32] (t1): 16433 all packrows, 12709 to open (including 12428 full)
2009-08-31 21:45:07 [32] Join execution plan:
2009-08-31 21:45:07 [32] Cnd(2):  t:-3 a:4 = t:-1 a:1   (39.61)
2009-08-31 21:45:09 [32] Traversed all 280566 rows.
2009-08-31 21:45:12 [32] Stopped by user.
2009-08-31 21:45:34 [34] T:-1 = TABLE_ALIAS(T:0,“spoof_2_section”)
T:-2 = TMP_TABLE(T:-1)
T:-3 = TABLE_ALIAS(T:1,“oas_log”)
T:-2.JOIN(T:-3)
F:0 = CREATE_FILTER(T:-2,TERM(t:-3 a:0),BETWEEN,TERM(vt:2009-08-24 00:00:00),TERM(vt:2009-08-26 23:59:59),WHERE)
F:0 = AND(F:0,TERM(t:-1 a:3),=,TERM(vn:2),TERM(<null>))
F:0 = AND(F:0,TERM(t:-3 a:4),=,TERM(t:-1 a:1),TERM(<null>))
T:-2.FILTER(F:0)
A:-1 = T:-2.ADD_COLUMN(TERM(t:-1 a:2),GROUP_BY,“section”,“ALL”)
A:-2 = T:-2.ADD_COLUMN(TERM(t:-3 a:7),GROUP_BY,“pos”,“ALL”)
A:-3 = T:-2.ADD_COLUMN(TERM(<null>),COUNT,“scount”,“ALL”)
A:-4 = T:-2.ADD_COLUMN(TERM(<null>),COUNT,“null”,“ALL”)
T:-2.ADD_ORDER(A:-4,0)
RESULT(T:-2)

Continued in next post.

Profile
 
Posted: 01 September 2009 10:25 AM   Ignore ]   [ # 10 ]  
Newbie
Rank
Total Posts:  14
Joined  2009-04-29

2009-08-31 21:45:34 [34] Initial execution plan (non-join):
2009-08-31 21:45:34 [34] Cnd(0):  t:-1 a:3 BET. vn:2 AND vn:2   (12.69)
2009-08-31 21:45:34 [34] Cnd(1):  t:-3 a:0 BET. vn:2.761900195e+16 AND vn:2.761905564e+16   (20.52)
2009-08-31 21:45:34 [34] Packs/packrows after KN evaluation:
2009-08-31 21:45:34 [34] (t0) Pckrows: 18, susp. 6 (12 empty 0 full). Packs opened in 1 cond.: 2
2009-08-31 21:45:34 [34] (t1) Pckrows: 16433, susp. 12709 (3724 empty 0 full). Packs opened in 1 cond.: 281
2009-08-31 21:45:34 [34] (t0-t1) Pack2Pack pairs: 25.77% possible.
2009-08-31 21:45:35 [34] Packrows after exact evaluation (WHERE):
2009-08-31 21:45:35 [34] (t0): 18 all packrows, 6 to open (including 4 full)
2009-08-31 21:45:35 [34] (t1): 16433 all packrows, 12709 to open (including 12428 full)
2009-08-31 21:45:35 [34] Join execution plan:
2009-08-31 21:45:35 [34] Cnd(2):  t:-3 a:4 = t:-1 a:1   (39.61)
2009-08-31 21:45:36 [34] Traversed all 280566 rows.
2009-08-31 21:46:04 [35] T:-1 = TABLE_ALIAS(T:0,“spoof_2_section”)
T:-2 = TMP_TABLE(T:-1)
T:-3 = TABLE_ALIAS(T:1,“oas_log”)
T:-2.JOIN(T:-3)
F:0 = CREATE_FILTER(T:-2,TERM(t:-3 a:0),BETWEEN,TERM(vt:2009-08-24 00:00:00),TERM(vt:2009-08-26 23:59:59),WHERE)
F:0 = AND(F:0,TERM(t:-1 a:3),=,TERM(vn:3),TERM(<null>))
F:0 = AND(F:0,TERM(t:-3 a:4),=,TERM(t:-1 a:1),TERM(<null>))
T:-2.FILTER(F:0)
A:-1 = T:-2.ADD_COLUMN(TERM(t:-1 a:2),GROUP_BY,“section”,“ALL”)
A:-2 = T:-2.ADD_COLUMN(TERM(t:-3 a:7),GROUP_BY,“pos”,“ALL”)
A:-3 = T:-2.ADD_COLUMN(TERM(<null>),COUNT,“scount”,“ALL”)
A:-4 = T:-2.ADD_COLUMN(TERM(<null>),COUNT,“null”,“ALL”)
T:-2.ADD_ORDER(A:-4,0)
RESULT(T:-2)

2009-08-31 21:46:04 [35] Initial execution plan (non-join):
2009-08-31 21:46:04 [35] Cnd(0):  t:-1 a:3 BET. vn:3 AND vn:3   (12.47)
2009-08-31 21:46:04 [35] Cnd(1):  t:-3 a:0 BET. vn:2.761900195e+16 AND vn:2.761905564e+16   (20.52)
2009-08-31 21:46:04 [35] Packs/packrows after KN evaluation:
2009-08-31 21:46:04 [35] (t0) Pckrows: 18, susp. 5 (13 empty 0 full). Packs opened in 1 cond.: 2
2009-08-31 21:46:04 [35] (t1) Pckrows: 16433, susp. 12709 (3724 empty 0 full). Packs opened in 1 cond.: 281
2009-08-31 21:46:04 [35] (t0-t1) Pack2Pack pairs: 21.48% possible.
2009-08-31 21:46:05 [35] Packrows after exact evaluation (WHERE):
2009-08-31 21:46:05 [35] (t0): 18 all packrows, 5 to open (including 3 full)
2009-08-31 21:46:05 [35] (t1): 16433 all packrows, 12709 to open (including 12428 full)
2009-08-31 21:46:05 [35] Join execution plan:
2009-08-31 21:46:05 [35] Cnd(2):  t:-3 a:4 = t:-1 a:1   (39.62)
2009-08-31 21:46:06 [35] Traversed all 304817 rows.
2009-08-31 21:46:27 [36] T:-1 = TABLE_ALIAS(T:0,“spoof_2_section”)
T:-2 = TMP_TABLE(T:-1)
T:-3 = TABLE_ALIAS(T:1,“oas_log”)
T:-2.JOIN(T:-3)
F:0 = CREATE_FILTER(T:-2,TERM(t:-3 a:0),BETWEEN,TERM(vt:2009-08-24 00:00:00),TERM(vt:2009-08-26 23:59:59),WHERE)
F:0 = AND(F:0,TERM(t:-1 a:3),=,TERM(vn:4),TERM(<null>))
F:0 = AND(F:0,TERM(t:-3 a:4),=,TERM(t:-1 a:1),TERM(<null>))
T:-2.FILTER(F:0)
A:-1 = T:-2.ADD_COLUMN(TERM(t:-1 a:2),GROUP_BY,“section”,“ALL”)
A:-2 = T:-2.ADD_COLUMN(TERM(t:-3 a:7),GROUP_BY,“pos”,“ALL”)
A:-3 = T:-2.ADD_COLUMN(TERM(<null>),COUNT,“scount”,“ALL”)
A:-4 = T:-2.ADD_COLUMN(TERM(<null>),COUNT,“null”,“ALL”)
T:-2.ADD_ORDER(A:-4,0)
RESULT(T:-2)

2009-08-31 21:46:27 [36] Initial execution plan (non-join):
2009-08-31 21:46:27 [36] Cnd(0):  t:-1 a:3 BET. vn:4 AND vn:4   (12.4)
2009-08-31 21:46:27 [36] Cnd(1):  t:-3 a:0 BET. vn:2.761900195e+16 AND vn:2.761905564e+16   (20.52)
2009-08-31 21:46:27 [36] Packs/packrows after KN evaluation:
2009-08-31 21:46:27 [36] (t0) Pckrows: 18, susp. 5 (13 empty 0 full). Packs opened in 1 cond.: 1
2009-08-31 21:46:27 [36] (t1) Pckrows: 16433, susp. 12709 (3724 empty 0 full). Packs opened in 1 cond.: 281
2009-08-31 21:46:27 [36] (t0-t1) Pack2Pack pairs: 21.48% possible.
2009-08-31 21:46:28 [36] Packrows after exact evaluation (WHERE):
2009-08-31 21:46:28 [36] (t0): 18 all packrows, 5 to open (including 4 full)
2009-08-31 21:46:28 [36] (t1): 16433 all packrows, 12709 to open (including 12428 full)
2009-08-31 21:46:28 [36] Join execution plan:
2009-08-31 21:46:28 [36] Cnd(2):  t:-3 a:4 = t:-1 a:1   (39.57)
2009-08-31 21:46:30 [36] Traversed all 230971 rows.
2009-08-31 22:26:18 [36] Produced 1728117148 tuples.
2009-08-31 22:26:18 [31] Produced 2500039868 tuples.
2009-08-31 22:26:36 [35] Produced 2617668599 tuples.
2009-08-31 22:27:06 [34] Produced 2329585498 tuples.
2009-08-31 22:29:36 [36] Sorting roughly multiindex…
2009-08-31 22:29:49 [31] Sorting roughly multiindex…
2009-08-31 22:30:06 [34] Sorting roughly multiindex…
2009-08-31 22:30:20 [35] Sorting roughly multiindex…
2009-08-31 23:32:45 [36] Updating P2P…
2009-08-31 23:43:30 [36] Tuples after inner join 0-1 [hash]: 1728117148
2009-08-31 23:43:46 [36] Aggregating: 1728117148 tuples left, 0 gr. found so far
2009-08-31 23:57:46 [34] Tuples after inner join 0-1 [hash]: 2329585498
2009-08-31 23:59:32 [34] Aggregating: 2329585498 tuples left, 0 gr. found so far
2009-09-01 00:02:08 [31] Updating P2P…
2009-09-01 00:07:32 [35] Tuples after inner join 0-1 [hash]: 2617668599
2009-09-01 00:08:54 [35] Aggregating: 2617668599 tuples left, 0 gr. found so far
2009-09-01 00:12:58 [31] RSI_PP updated by 64.44%. Pairs possible: 100%
2009-09-01 00:12:58 [31] Tuples after inner join 0-1 [hash]: 2500039868
2009-09-01 00:13:14 [31] Aggregating: 2500039868 tuples left, 0 gr. found so far
2009-09-01 00:22:30 [36] Aggregated (1340 gr). Omitted packrows: 0 + 0 partially, out of 63604 total.
2009-09-01 00:22:43 [36] Sorting 1340 rows…
2009-09-01 00:22:43 [36] Sorted with 26-bit keys.
2009-09-01 00:22:43 [36] Displaying result: 1340 rows.
2009-09-01 00:22:43 [36] Total data packs actually loaded (approx.): 18332
2009-09-01 00:22:43 [36]——————————————————————————————————————

Continued in next post.

Profile
 
Posted: 01 September 2009 10:30 AM   Ignore ]   [ # 11 ]  
Newbie
Rank
Total Posts:  14
Joined  2009-04-29

2009-09-01 02:42:54 [31] Error: I/O operation on /var/lib/mysql/etc/cache/PS_CB_0000185E10A20x158cf930.bh_tmp failed with error - No space left on device File name /var/lib/mysql/etc/cache/PS_CB_0000185E10A20x158cf930.bh_tmp
2009-09-01 02:43:05 [35] Error: I/O operation on /var/lib/mysql/etc/cache/PS_CB_0000181F0x2aaab0223f00.bh_tmp failed with error - No space left on device File name /var/lib/mysql/etc/cache/PS_CB_0000181F0x2aaab0223f00.bh_tmp
2009-09-01 02:44:04 [34] Error: I/O operation on /var/lib/mysql/etc/cache/PS_CB_000062640x2aaaada87e20.bh_tmp failed with error - No space left on device File name /var/lib/mysql/etc/cache/PS_CB_000062640x2aaaada87e20.bh_tmp

As I said before, the same exact queries ran to completion using only a few Gig of temp space when the time constraint limited the log results to 500 million rows instead of 800 million.

Any help here would be greatly appreciated.  I can run any additional queries needed to provide more data.

Thanks,
Scott

Profile
 
Posted: 01 September 2009 10:35 AM   Ignore ]   [ # 12 ]  
Sr. Member
Avatar
RankRankRankRank
Total Posts:  763
Joined  2008-08-18

Hi Scott,

We are working on this issue right now. Thanks for all the input!

Regards,

Signature 
Profile
 
Posted: 01 September 2009 03:19 PM   Ignore ]   [ # 13 ]  
Newbie
Rank
Total Posts:  14
Joined  2009-04-29

To find out if running the 4 queries simultaneously was triggering the runaway cache files, I ran one of the offending queries by itself.  Sure enough after about 1.5 hours, it started eating all the 200+ Gig available on the cache drive.  Here are the bh.err lines for that query:  I have let it continue to run, but expect it to terminate shortly when it runs out of space.

2009-09-01 11:18:59 [37] T:-1 = TABLE_ALIAS(T:0,“spoof_2_section”)
T:-2 = TMP_TABLE(T:-1)
T:-3 = TABLE_ALIAS(T:1,“oas_log”)
T:-2.JOIN(T:-3)
F:0 = CREATE_FILTER(T:-2,TERM(t:-3 a:0),BETWEEN,TERM(vt:2009-08-24 00:00:00),TERM(vt:2009-08-26 23:59:59),WHERE)
F:0 = AND(F:0,TERM(t:-1 a:3),=,TERM(vn:1),TERM(<null>))
F:0 = AND(F:0,TERM(t:-3 a:4),=,TERM(t:-1 a:1),TERM(<null>))
T:-2.FILTER(F:0)
A:-1 = T:-2.ADD_COLUMN(TERM(t:-1 a:2),GROUP_BY,“section”,“ALL”)
A:-2 = T:-2.ADD_COLUMN(TERM(t:-3 a:7),GROUP_BY,“pos”,“ALL”)
A:-3 = T:-2.ADD_COLUMN(TERM(<null>),COUNT,“scount”,“ALL”)
A:-4 = T:-2.ADD_COLUMN(TERM(<null>),COUNT,“null”,“ALL”)
T:-2.ADD_ORDER(A:-4,0)
RESULT(T:-2)

2009-09-01 11:18:59 [37] Initial execution plan (non-join):
2009-09-01 11:18:59 [37] Cnd(0):  t:-1 a:3 BET. vn:1 AND vn:1   (12.59)
2009-09-01 11:18:59 [37] Cnd(1):  t:-3 a:0 BET. vn:2.761900195e+16 AND vn:2.761905564e+16   (20.52)
2009-09-01 11:19:00 [37] Packs/packrows after KN evaluation:
2009-09-01 11:19:00 [37] (t0) Pckrows: 18, susp. 5 (13 empty 0 full). Packs opened in 1 cond.: 1
2009-09-01 11:19:00 [37] (t1) Pckrows: 16433, susp. 12709 (3724 empty 0 full). Packs opened in 1 cond.: 281
2009-09-01 11:19:00 [37] (t0-t1) Pack2Pack pairs: 21.48% possible.
2009-09-01 11:19:03 [37] Packrows after exact evaluation (WHERE):
2009-09-01 11:19:03 [37] (t0): 18 all packrows, 5 to open (including 4 full)
2009-09-01 11:19:03 [37] (t1): 16433 all packrows, 12709 to open (including 12428 full)
2009-09-01 11:19:03 [37] Join execution plan:
2009-09-01 11:19:03 [37] Cnd(2):  t:-3 a:4 = t:-1 a:1   (39.63)
2009-09-01 11:19:03 [37] Traversed all 312924 rows.
2009-09-01 11:40:33 [37] Produced 2500039868 tuples.
2009-09-01 11:41:26 [37] Sorting roughly multiindex…
2009-09-01 13:02:54 [37] Tuples after inner join 0-1 [hash]: 2500039868
2009-09-01 13:03:41 [37] Aggregating: 2500039868 tuples left, 0 gr. found so far

Profile
 
Posted: 01 September 2009 05:06 PM   Ignore ]   [ # 14 ]  
Sr. Member
Avatar
RankRankRankRank
Total Posts:  763
Joined  2008-08-18
f300v10 - 01 September 2009 03:19 PM

To find out if running the 4 queries simultaneously was triggering the runaway cache files, I ran one of the offending queries by itself.  Sure enough after about 1.5 hours, it started eating all the 200+ Gig available on the cache drive.

Sounds familiar. Fixed today…

Regards,

Signature 
Profile
 
Posted: 01 September 2009 05:56 PM   Ignore ]   [ # 15 ]  
Newbie
Rank
Total Posts:  14
Joined  2009-04-29

Excellent.  Any idea when we should be able to get a version of ICE with the fix?

Profile
 
   
1 of 2
1