[MDEV-278] SUBOPTIMIZED QUERY PLAIN Created: 2012-05-17 Updated: 2012-06-22 Resolved: 2012-06-22 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Trivial |
| Reporter: | roberto spadim | Assignee: | Unassigned |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Environment: |
VERSION IS 5.2.4 - DOWNLOAD FROM MARIADB WEB SITE |
||
| Description |
|
Hi guys, i don't know if it's the right place to post it, but... if not tell me where to post, or not post... I have a server with mariadb (a bit old version 5.2.4) and it executed a bad plain in query, could you check why it's suboptimized? well it's a big table... i will post where to download data here is the query:
|
| Comments |
| Comment by Elena Stepanova [ 2012-05-17 ] |
|
Hi, 5.2.4 is 1.5 years old.. Is the problem reproducible on any recent release (be it 5.2.12 or 5.3.7 or 5.5.23)? Thank you |
| Comment by roberto spadim [ 2012-05-17 ] |
|
hi, starting download of 5.5.23 |
| Comment by Elena Stepanova [ 2012-05-17 ] |
|
>> a doubt about jira... there's some place that i can 'end' this 'bug' report if the result is ok? You might have the button "Close issue" at the top of the screen. If you don't, just leave a comment here and we'll close it. |
| Comment by roberto spadim [ 2012-05-17 ] |
|
nice |
| Comment by Elena Stepanova [ 2012-05-17 ] |
|
>> if 'bug' isn't closed and no reply is done, there's a 'waiting return' status? I don't think so, the list of status values seems to be pretty short – it's pretty much just Open, In Progress and Closed (well, and Re-opened). And when someone closes a bug, there is also a 'Resolution' value which explains why the bug gets closed (Fixed, Won't fix etc.). |
| Comment by roberto spadim [ 2012-05-17 ] |
|
Hi, i forgot the cfop_itens table, it's on: well i put the new mariadb 5.5.23 in another machine and dumped the table to it... it´s not like the dell server, but can give results too http://spd1.agraagroindustrial.com.br:3080/mariadb-log/MARIA-mdev278-results.txt in less words... -------------------------------------------- |
| Comment by Elena Stepanova [ 2012-05-18 ] |
|
Hi, I got pretty much the same results as you (apart from the absolute numbers). Your last observation explains it. It is not OPTIMIZE itself that resolves the problem, it is the part of it that analyzes the table and updates the statistics. You can run ANALYZE instead and get the same result. For this particular query, running ANALYZE on spamov_itens makes the difference, but you might want to run it on all tables, just in case. |
| Comment by Elena Stepanova [ 2012-05-18 ] |
|
If you didn't run it before at all (or haven't run for very long time), I suggest to try to run it once and then see how it goes. Depending on the workload, it's quite possible that you will only need to do it once in a few months, which I expect you should be able to afford (you do have backup times, maintenance windows etc., right?) |
| Comment by roberto spadim [ 2012-05-25 ] |
|
yes, i need check time to analyse table no problem... |
| Comment by Elena Stepanova [ 2012-05-31 ] |
|
Hi, Sorry, missed your question before. For MyISAM tables, accurate statistics is not available until you executed ANALYZE at least once, so you can easily have bad results even if you didn't do update/delete. Please see bug http://bugs.mysql.com/bug.php?id=34467 for more information. |
| Comment by roberto spadim [ 2012-06-01 ] |
|
humm in others words... it will run better? |
| Comment by Elena Stepanova [ 2012-06-01 ] |
|
No, you need to run ANALYZE after INSERTs. ANALYZE collects cardinality data, if you run it on an empty table, the results will become useless after inserting data. |
| Comment by roberto spadim [ 2012-06-01 ] |
|
hum... what bug says (34467) is that innodb can do analyze online without analyze table, and myisam and head don't, that's right? in other words i will need a time to run it what about aria, it's execute like myisam? |
| Comment by Elena Stepanova [ 2012-06-01 ] |
|
Aria behaves pretty much like MyISAM in this regard. In case of Aria, for partial workaround suggested by James Day in the comment of [8 Nov 2010 13:10], you'll need to use aria_max_sort_file_size instead of myisam_max_sort_file_size. |
| Comment by Elena Stepanova [ 2012-06-15 ] |
|
Hi Roberto, Has ANALYZE fixed your problem? Can we close the bug? Thanks. |
| Comment by roberto spadim [ 2012-06-15 ] |
|
hi elena, yes it worked fine after analyze i didn´t tested it again, i will test with the icp switch off (like the mdev-337), maybe icp is the problem |
| Comment by roberto spadim [ 2012-06-15 ] |
|
yes, please close, any problem i open another bug |
| Comment by Elena Stepanova [ 2012-06-15 ] |
|
In the absence of better 'resolution' value, closing as 'Won't fix' (should have been 'Not a bug'). |