{"action":"created","issue":{"url":"https://api.github.com/repos/cockroachdb/cockroach/issues/24370","repository_url":"https://api.github.com/repos/cockroachdb/cockroach","labels_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/24370/labels{/name}","comments_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/24370/comments","events_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/24370/events","html_url":"https://github.com/cockroachdb/cockroach/issues/24370","id":310129835,"number":24370,"title":"opt: make memo output more readable","user":{"login":"RaduBerinde","id":16544120,"avatar_url":"https://avatars1.githubusercontent.com/u/16544120?v=4","gravatar_id":"","url":"https://api.github.com/users/RaduBerinde","html_url":"https://github.com/RaduBerinde","followers_url":"https://api.github.com/users/RaduBerinde/followers","following_url":"https://api.github.com/users/RaduBerinde/following{/other_user}","gists_url":"https://api.github.com/users/RaduBerinde/gists{/gist_id}","starred_url":"https://api.github.com/users/RaduBerinde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RaduBerinde/subscriptions","organizations_url":"https://api.github.com/users/RaduBerinde/orgs","repos_url":"https://api.github.com/users/RaduBerinde/repos","events_url":"https://api.github.com/users/RaduBerinde/events{/privacy}","received_events_url":"https://api.github.com/users/RaduBerinde/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"RaduBerinde","id":16544120,"avatar_url":"https://avatars1.githubusercontent.com/u/16544120?v=4","gravatar_id":"","url":"https://api.github.com/users/RaduBerinde","html_url":"https://github.com/RaduBerinde","followers_url":"https://api.github.com/users/RaduBerinde/followers","following_url":"https://api.github.com/users/RaduBerinde/following{/other_user}","gists_url":"https://api.github.com/users/RaduBerinde/gists{/gist_id}","starred_url":"https://api.github.com/users/RaduBerinde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RaduBerinde/subscriptions","organizations_url":"https://api.github.com/users/RaduBerinde/orgs","repos_url":"https://api.github.com/users/RaduBerinde/repos","events_url":"https://api.github.com/users/RaduBerinde/events{/privacy}","received_events_url":"https://api.github.com/users/RaduBerinde/received_events","type":"User","site_admin":false},"assignees":[{"login":"RaduBerinde","id":16544120,"avatar_url":"https://avatars1.githubusercontent.com/u/16544120?v=4","gravatar_id":"","url":"https://api.github.com/users/RaduBerinde","html_url":"https://github.com/RaduBerinde","followers_url":"https://api.github.com/users/RaduBerinde/followers","following_url":"https://api.github.com/users/RaduBerinde/following{/other_user}","gists_url":"https://api.github.com/users/RaduBerinde/gists{/gist_id}","starred_url":"https://api.github.com/users/RaduBerinde/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RaduBerinde/subscriptions","organizations_url":"https://api.github.com/users/RaduBerinde/orgs","repos_url":"https://api.github.com/users/RaduBerinde/repos","events_url":"https://api.github.com/users/RaduBerinde/events{/privacy}","received_events_url":"https://api.github.com/users/RaduBerinde/received_events","type":"User","site_admin":false}],"milestone":null,"comments":0,"created_at":"2018-03-30T18:01:03Z","updated_at":"2018-03-30T18:03:51Z","closed_at":null,"author_association":"OWNER","body":"The `memo` test output currently looks like this:\r\n```\r\n[9: \"p:k:1\"]\r\nmemo\r\n ├── 10: (true)\r\n ├── 9: (select 8 5) (scan a,constrained)\r\n │    └── \"p:k:1\" [cost=100.00]\r\n │         └── best: (scan a,constrained)\r\n ├── 8: (scan a) (scan a@u) (scan a@v)\r\n │    └── \"\" [cost=1000.00]\r\n │         └── best: (scan a)\r\n ├── 7: (projections 2)\r\n ├── 6: (select 1 5)\r\n ├── 5: (filters 4)\r\n ├── 4: (eq 2 3)\r\n ├── 3: (const 1)\r\n ├── 2: (variable a.k)\r\n └── 1: (scan a)\r\n```\r\n\r\nThere are various things we can do to improve this:\r\n - sort the groups topologically, with the root group first\r\n - hide \"orphan\" groups (groups unreachable from the root); this should be controlled by a flag though (for debugging garbage accumulation)\r\n - don't label groups with plain integers; maybe G1, G2, or A, B, C.\r\n - improve the readability of the physical properties (`p:k:1`); maybe label them with `physical`.\r\n\r\nCC @andy-kimball @petermattis\r\n\r\n@justinj this could be a good project for you - it's useful and would familiarize you with the memo data structures. If you want to work on it, feel free to reassign."},"comment":{"url":"https://api.github.com/repos/cockroachdb/cockroach/issues/comments/377584615","html_url":"https://github.com/cockroachdb/cockroach/issues/24370#issuecomment-377584615","issue_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/24370","id":377584615,"user":{"login":"petermattis","id":6201335,"avatar_url":"https://avatars0.githubusercontent.com/u/6201335?v=4","gravatar_id":"","url":"https://api.github.com/users/petermattis","html_url":"https://github.com/petermattis","followers_url":"https://api.github.com/users/petermattis/followers","following_url":"https://api.github.com/users/petermattis/following{/other_user}","gists_url":"https://api.github.com/users/petermattis/gists{/gist_id}","starred_url":"https://api.github.com/users/petermattis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petermattis/subscriptions","organizations_url":"https://api.github.com/users/petermattis/orgs","repos_url":"https://api.github.com/users/petermattis/repos","events_url":"https://api.github.com/users/petermattis/events{/privacy}","received_events_url":"https://api.github.com/users/petermattis/received_events","type":"User","site_admin":false},"created_at":"2018-03-30T18:03:51Z","updated_at":"2018-03-30T18:03:51Z","author_association":"CONTRIBUTOR","body":"> sort the groups topologically, with the root group first\r\n\r\nFYI, `opttoy/v3` had [topological sort](https://github.com/petermattis/opttoy/blob/master/v3/memo.go#L312) code which could probably be adapted.\r\n\r\n> don't label groups with plain integers; maybe G1, G2, or A, B, C.\r\n\r\nThe plain integer labelling is what we've seen in some of the literature. I'm not sure if another labelling would be better."}}
{"actor":{"display_login":"petermattis"}}