Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Fix a buffer overrun in the previous commit. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | query-planner-fix |
Files: | files | file ages | folders |
SHA1: |
43c59c85436dc8001c81f4aac7f5231b |
User & Date: | dan 2014-08-08 17:25:33.967 |
Context
2014-08-08
| ||
17:49 | Improvements to the way the query planner handles sorting costs, so that very large sorting costs do not overwhelm the loop costs. (check-in: bdaa694737 user: drh tags: trunk) | |
17:25 | Fix a buffer overrun in the previous commit. (Closed-Leaf check-in: 43c59c8543 user: dan tags: query-planner-fix) | |
16:52 | Because SQLite internally calculates query plan costs using a logarithmic scale, very large estimated sorting costs can cause all other estimated costs to be rounded down to zero. In these cases break ties between plans with the same total cost by comparing the costs with sorting excluded. This is an alternative fix for the problem addressed by [2af630c572]. (check-in: 299b957027 user: dan tags: query-planner-fix) | |
Changes
Changes to src/where.c.
︙ | |||
5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 | 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 | + | WherePath *aTo; /* The nTo best paths at the current level */ WherePath *pFrom; /* An element of aFrom[] that we are working on */ WherePath *pTo; /* An element of aTo[] that we are working on */ WhereLoop *pWLoop; /* One of the WhereLoop objects */ WhereLoop **pX; /* Used to divy up the pSpace memory */ LogEst *aSortCost = 0; /* Sorting and partial sorting costs */ char *pSpace; /* Temporary memory used by this routine */ int nSpace; /* Bytes of space allocated at pSpace */ pParse = pWInfo->pParse; db = pParse->db; nLoop = pWInfo->nLevel; /* TUNING: For simple queries, only the best path is tracked. ** For 2-way joins, the 5 best paths are followed. ** For joins of 3 or more tables, track the 10 best paths */ |
︙ | |||
5490 5491 5492 5493 5494 5495 5496 | 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 | - - - + + + - + + + | if( pWInfo->pOrderBy==0 || nRowEst==0 ){ nOrderBy = 0; }else{ nOrderBy = pWInfo->pOrderBy->nExpr; } /* Allocate and initialize space for aTo, aFrom and aSortCost[] */ |
︙ |