Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Performance boost in sqlite3VdbeRecordCompare. (CVS 2929) |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
14c423075bcebf42a3f4e24838bc865c |
User & Date: | drh 2006-01-12 20:28:35.000 |
Context
2006-01-12
| ||
22:17 | Add support for the TOTAL() aggregate function - works like SUM() except that it returns 0 instead of NULL when presented with an empty list. (CVS 2930) (check-in: a7f528ff34 user: drh tags: trunk) | |
20:28 | Performance boost in sqlite3VdbeRecordCompare. (CVS 2929) (check-in: 14c423075b user: drh tags: trunk) | |
19:42 | Automatically cast BLOBs to strings prior to handing them over to functions like LIKE that want strings. Ticket #1605. (CVS 2928) (check-in: 730ddb0b74 user: drh tags: trunk) | |
Changes
Changes to src/vdbeaux.c.
︙ | ︙ | |||
1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 | } return len; } } return 0; } /* ** This function compares the two table rows or index records specified by ** {nKey1, pKey1} and {nKey2, pKey2}, returning a negative, zero ** or positive integer if {nKey1, pKey1} is less than, equal to or ** greater than {nKey2, pKey2}. Both Key1 and Key2 must be byte strings ** composed by the OP_MakeRecord opcode of the VDBE. */ | > > > > > > > > > > > > > > > > > | 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 | } return len; } } return 0; } /* ** The header of a record consists of a sequence variable-length integers. ** These integers are almost always small and are encoded as a single byte. ** The following macro takes advantage this fact to provide a fast decode ** of the integers in a record header. It is faster for the common case ** where the integer is a single byte. It is a little slower when the ** integer is two or more bytes. But overall it is faster. ** ** The following expressions are equivalent: ** ** x = sqlite3GetVarint32( A, &B ); ** ** x = GetVarint( A, B ); ** */ #define GetVarint(A,B) ((B = *(A))<=0x7f ? 1 : sqlite3GetVarint32(A, &B)) /* ** This function compares the two table rows or index records specified by ** {nKey1, pKey1} and {nKey2, pKey2}, returning a negative, zero ** or positive integer if {nKey1, pKey1} is less than, equal to or ** greater than {nKey2, pKey2}. Both Key1 and Key2 must be byte strings ** composed by the OP_MakeRecord opcode of the VDBE. */ |
︙ | ︙ | |||
1703 1704 1705 1706 1707 1708 1709 | const unsigned char *aKey2 = (const unsigned char *)pKey2; Mem mem1; Mem mem2; mem1.enc = pKeyInfo->enc; mem2.enc = pKeyInfo->enc; | | | | | | 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 | const unsigned char *aKey2 = (const unsigned char *)pKey2; Mem mem1; Mem mem2; mem1.enc = pKeyInfo->enc; mem2.enc = pKeyInfo->enc; idx1 = GetVarint(aKey1, szHdr1); d1 = szHdr1; idx2 = GetVarint(aKey2, szHdr2); d2 = szHdr2; nField = pKeyInfo->nField; while( idx1<szHdr1 && idx2<szHdr2 ){ u32 serial_type1; u32 serial_type2; /* Read the serial types for the next element in each key. */ idx1 += GetVarint( aKey1+idx1, serial_type1 ); if( d1>=nKey1 && sqlite3VdbeSerialTypeLen(serial_type1)>0 ) break; idx2 += GetVarint( aKey2+idx2, serial_type2 ); if( d2>=nKey2 && sqlite3VdbeSerialTypeLen(serial_type2)>0 ) break; /* Assert that there is enough space left in each key for the blob of ** data to go with the serial type just read. This assert may fail if ** the file is corrupted. Then read the value from each key into mem1 ** and mem2 respectively. */ |
︙ | ︙ |