Commit Graph

276 Commits

Author SHA1 Message Date
31579bb3f0 Fix asyncGetTSWorker goroutine leak (#3291) 2017-05-22 16:53:31 +08:00
0dfc245aad *: change the schema of stats_bucket and stats_hist. (#3295) 2017-05-22 00:44:01 +08:00
10fc9fcd44 tidb: eliminate runtime.morestack from getTimestamp call stack (#3054) 2017-05-04 20:06:37 +08:00
a9a33b0209 fix typo (#3179) 2017-04-29 00:24:27 +08:00
9e1022a90c statistics: make getIntColumnRowCount correct (#3146)
If we use a > 1 to build range in physical plan builder phase, will get (1, +∞) first, then we will get a []types.IntColumnRange like [{2, +∞}].
However, this range will call function greaterRowCount(). So the result actually is calculated as (2, +∞).
This pr is to fix this.
2017-04-26 14:47:53 +08:00
93f4780f40 plan: add variable countReliable to physicalPlanInfo (#3011) 2017-04-24 17:07:31 +08:00
ef7bdb0d1f ddl, statistics: support drop table and schema. (#3106) 2017-04-22 16:48:28 +08:00
bbad497023 ddl, statistics: update the stats table after creating/ droping column. (#3061) 2017-04-21 11:51:06 +08:00
0f2afbf44b statistics: prepare for analyze part of a table (#3062)
We need to make somthing like 'analyze index...' work, this is only the first step.
2017-04-20 14:05:51 +08:00
375148460f statistics: process the case that we lack a column in stats table (#3075)
When we can't find a column in stats table, we return a pseudo table for now. It's not reasonable.
We should return a real table and use pseudo estimation for the missed histogram.
2017-04-18 23:34:52 +08:00
6fa6a990f8 statistics: use PrevLastVersion to avoid error. (#3060)
Currently, we use startTS of a txn as the version of a stats table. There may be an error like this:
txn1 with version 2 write firstly.
TiDB update it, and the latest udpate version is 2.
then txn2 with version 1 write.
TiDB will never get it with the version 2.

So we choose to get the table stats which version is greator than the version before last two lease.
2017-04-17 22:50:03 +08:00
10e005f1e6 statistics: every histogram use its own version to update. (#3059)
after we support delta updae in #3053 , we shouldn't load the whole histogram when we find the table version updated. Every histogram has it's own version.
2017-04-17 21:13:18 +08:00
3126e5e341 *: online update count in table stats. (#3053)
When insert and update happens, we will cache the changed info in every session. After a duration(five minutes now) passes, handle will sweep every cache and merge them. Then dump the delta info to TiKV.
2017-04-15 21:20:44 +08:00
846ad93577 *: update stats after creating table. (#3048) 2017-04-14 14:26:54 +08:00
dcf12b5273 statistics: refactor statistics package. (#3044) 2017-04-13 13:13:52 +08:00
8a87d775b8 statistics: remove rlock using copy on write. (#3029)
every time we update stats cache, we copy the whole map. By this way we can avoid rlock.
2017-04-12 10:22:22 +08:00
113070162e statistics: separate Column and Index Histogram (#3031) 2017-04-11 17:24:17 +08:00
4ce98317ce *: put the stats map to stats handle to make test more easier. (#3014) 2017-04-10 17:01:00 +08:00
e3a0dc68ce *: use column id to get stats instead of column offset (#3019)
Now we assume that the order of columns in stats matches the column offsets. It will return wrong stats sometimes.
If we analyze when a table is (c1, c2) and then drop c1, the c2's offset will become 0. But in stats the position of 0 is c1. I have added this case to test.
2017-04-10 16:03:20 +08:00
b6ff4ad4b1 statistics: add bucket structure. (#2993) 2017-04-06 10:15:18 +08:00
2bac467c0d with some spelling mistakes (#2986) 2017-04-05 10:34:09 +08:00
16cefef717 executor, statistics: use FM sketch to estimate NDV (#2966) 2017-04-01 15:03:54 +08:00
82285af11d *: change the way of column estimating. (#2956)
When the ddl happens after loading stats. We can estimate as peusdo column for the missed column, instead of making the whole table peusdo.
I havn't processed the case of index. It's the first step.
2017-04-01 14:55:09 +08:00
6d7dc9228a statistics: implement FM Sketch (#2947) 2017-03-30 11:27:16 +08:00
e7bb049b0e statistics: adjust codes. (#2952) 2017-03-29 18:09:47 +08:00
ee7df059e3 statistics: refactor package. (#2913) 2017-03-29 11:32:40 +08:00