~maria-captains/maria/5.5-explain-analyze

« back to all changes in this revision

Viewing changes to sql/sql_select.h

  • Committer: Sergey Petrunya
  • Date: 2012-09-03 15:11:24 UTC
  • Revision ID: psergey@askmonty.org-20120903151124-s1y9vrz3k4ezy642
MDEV-406: EXPLAIN ANALYZE 
- First code, it is possible to get the data for joins/unions
- Numbers for join buffering are likely to be incorrect
- Same for subqueries (what should 'loops' show?)

Show diffs side-by-side

added added

removed removed

Lines of Context:
412
412
  uint n_sj_tables;
413
413
 
414
414
  bool preread_init_done;
 
415
  /* 
 
416
    psergey-explain-analyze: the number of times a scan was done on this
 
417
    join_tab.
 
418
  */
 
419
  ulonglong loop_count;
 
420
 
 
421
  /*
 
422
    How many output records it has produced
 
423
 
 
424
     r_rows=  AVG(access method fanout) = pre_filtered_count/ loop_count
 
425
     r_filtered = AVG(tab's fanout) = post_filtered_count / loop_count 
 
426
 
 
427
  */
 
428
  ulonglong pre_filtered_count;
 
429
  ulonglong post_filtered_count;
415
430
 
416
431
  void cleanup();
417
432
  inline bool is_using_loose_index_scan()
1432
1447
  }
1433
1448
 
1434
1449
  int print_explain(select_result_sink *result, uint8 explain_flags,
1435
 
                     bool on_the_fly,
 
1450
                     bool on_the_fly, bool explain_analyze,
1436
1451
                     bool need_tmp_table, bool need_order,
1437
1452
                     bool distinct,const char *message);
1438
1453
private:
1787
1802
}
1788
1803
 
1789
1804
int print_fake_select_lex_join(select_result_sink *result, bool on_the_fly,
1790
 
                               SELECT_LEX *select_lex, uint8 select_options);
 
1805
                               SELECT_LEX *select_lex, uint8 select_options,
 
1806
                               bool explain_analyze);
1791
1807
 
1792
1808
uint get_index_for_order(ORDER *order, TABLE *table, SQL_SELECT *select,
1793
1809
                         ha_rows limit, bool *need_sort, bool *reverse);