{"action":"created","issue":{"url":"https://api.github.com/repos/greenplum-db/gpdb/issues/174","labels_url":"https://api.github.com/repos/greenplum-db/gpdb/issues/174/labels{/name}","comments_url":"https://api.github.com/repos/greenplum-db/gpdb/issues/174/comments","events_url":"https://api.github.com/repos/greenplum-db/gpdb/issues/174/events","html_url":"https://github.com/greenplum-db/gpdb/issues/174","id":122232007,"number":174,"title":"DELETE from appendonly tables produces strange results","user":{"login":"volkovandr","id":16303028,"avatar_url":"https://avatars.githubusercontent.com/u/16303028?v=3","gravatar_id":"","url":"https://api.github.com/users/volkovandr","html_url":"https://github.com/volkovandr","followers_url":"https://api.github.com/users/volkovandr/followers","following_url":"https://api.github.com/users/volkovandr/following{/other_user}","gists_url":"https://api.github.com/users/volkovandr/gists{/gist_id}","starred_url":"https://api.github.com/users/volkovandr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/volkovandr/subscriptions","organizations_url":"https://api.github.com/users/volkovandr/orgs","repos_url":"https://api.github.com/users/volkovandr/repos","events_url":"https://api.github.com/users/volkovandr/events{/privacy}","received_events_url":"https://api.github.com/users/volkovandr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-15T09:43:51Z","updated_at":"2015-12-16T01:16:49Z","closed_at":null,"body":"Hello\r\nI understand that appendonly tables are optimized for inserting. But since DELETE and UPDATE commands are supported in 4.3, I assume they are supposed to work properly. But they don't, at least DELETE doesn't. Here is an example:\r\n\r\n```\r\ndwh=# CREATE TABLE bar (a int, b text) WITH (appendonly=true) DISTRIBUTED BY (a);\r\nCREATE TABLE\r\ndwh=# INSERT INTO bar SELECT a, a::text FROM generate_series(1,1000000) a;\r\nINSERT 0 1000000\r\ndwh=# SELECT count(*) FROM bar;\r\ncount\r\n---------\r\n 1000000\r\n(1 row)\r\n\r\ndwh=# DELETE FROM bar;\r\nDELETE 1000000\r\ndwh=# SELECT count(*) FROM bar;\r\ncount\r\n--------\r\n 868928\r\n(1 row)\r\n\r\ndwh=# DELETE FROM bar;\r\nDELETE 868928\r\ndwh=# SELECT count(*) FROM bar;\r\ncount\r\n--------\r\n 868928\r\n(1 row)\r\n```\r\n\r\nAnd now the completely crazy thing:\r\n\r\n```\r\ndwh=# DELETE FROM bar WHERE a = 500;\r\nDELETE 1\r\ndwh=# DELETE FROM bar WHERE a = 501;\r\nDELETE 1\r\ndwh=# DELETE FROM bar WHERE a = 502;\r\nDELETE 1\r\ndwh=# SELECT count(*) FROM bar;\r\ncount\r\n--------\r\n 967229\r\n(1 row)\r\n```\r\nI've tried this on two different installations of GP: same result with only difference in the number of rows that are deleted and then \"restored\". Am I doing anything wrong?"},"comment":{"url":"https://api.github.com/repos/greenplum-db/gpdb/issues/comments/164952480","html_url":"https://github.com/greenplum-db/gpdb/issues/174#issuecomment-164952480","issue_url":"https://api.github.com/repos/greenplum-db/gpdb/issues/174","id":164952480,"user":{"login":"asimrp","id":4307811,"avatar_url":"https://avatars.githubusercontent.com/u/4307811?v=3","gravatar_id":"","url":"https://api.github.com/users/asimrp","html_url":"https://github.com/asimrp","followers_url":"https://api.github.com/users/asimrp/followers","following_url":"https://api.github.com/users/asimrp/following{/other_user}","gists_url":"https://api.github.com/users/asimrp/gists{/gist_id}","starred_url":"https://api.github.com/users/asimrp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asimrp/subscriptions","organizations_url":"https://api.github.com/users/asimrp/orgs","repos_url":"https://api.github.com/users/asimrp/repos","events_url":"https://api.github.com/users/asimrp/events{/privacy}","received_events_url":"https://api.github.com/users/asimrp/received_events","type":"User","site_admin":false},"created_at":"2015-12-16T01:16:49Z","updated_at":"2015-12-16T01:16:49Z","body":"@volkovandr thank you for reporting the issue and apologies for the inconvenient experience with Greenplum.  DML should work just as heap tables with appendonly row/column oriented tables.  I am investigating this issue on priority, please stay tuned.\r\n\r\nPlease note that I did not see this issue on 4.3 code line.\r\n"}}