Re: WIP: Covering + unique indexes. (the good and the bad)
Erik Rijkers <er@xs4all.nl>
On 2018-04-07 14:27, Alexander Korotkov wrote:
> On Sat, Apr 7, 2018 at 2:57 PM, Erik Rijkers <er@xs4all.nl> wrote:
>
>> On 2018-04-06 20:08, Alexander Korotkov wrote:
>>
>>> [0001-Covering-v15.patch]
>>>
>> After some more testing I notice there is also a down-side/slow-down
>> to
>> this patch that is not so bad but more than negligible, and I don't
>> think
>> it has been mentioned (but I may have missed something in this thread
>> that's now been running for 1.5 year, not to mention the tangential
>> btree-thread(s)).
>>
>> I attach my test-program, which compares master (this morning) with
>> covered_indexes (warning: it takes a while to generate the used
>> tables).
>>
>> The test tables are created as:
>> create table $t (c1 int, c2 int, c3 int, c4 int);
>> insert into $t (select x, 2*x, 3*x, 4 from generate_series(1,
>> $rowcount)
>> as x);
>> create unique index ${t}uniqueinclude_idx on $t using btree (c1, c2)
>> include (c3, c4);
>>
>> or for HEAD, just:
>> create unique index ${t}unique_idx on $t using btree (c1, c2);
>>
>
> Do I understand correctly that you compare unique index on (c1, c2)
> with
> master to unqiue index on (c1, c2) include (c3, c4) with patched
> version?
> If so then I think it's wrong to say about down-side/slow-down of this
> patch based on this comparison.
> Patch *does not* cause slowdown in this case. Patch provides user a
> *new
> option* which has its advantages and disadvantages. And what you
> compare
> is advantages and disadvantages of this option, not slow-down of the
> patch.
> In the case you compare *the same* index on master and patched version,
> then it's possible to say about slow-down of the patch.
OK, I take your point -- you are right. Although my measurement was (I
think) correct, my comparison was not (as Teodor wrote, not quite
'fair').
Sorry, I should have better thought that message through. The somewhat
longer time is indeed just a disadvantage of this new option, to be
balanced against the advantages that are pretty clear too.
Erik Rijkers
Commits
-
Adjust INCLUDE index truncation comments and code.
- 075aade4361b 11.0 landed
-
Add commentary explaining why MaxIndexTuplesPerPage calculation is safe.
- 2a67d6440db4 11.0 cited
-
Indexes with INCLUDE columns and their support in B-tree
- 8224de4f42cc 11.0 landed
-
Add amcheck verification of heap relations belonging to btree indexes.
- 7f563c09f890 11.0 cited
-
Doc: move info for btree opclass implementors into main documentation.
- 3785f7eee3d9 11.0 cited
-
Doc: mention that you can't PREPARE TRANSACTION after NOTIFY.
- e4fbf22831c2 11.0 cited
-
Remove dedicated B-tree root-split record types.
- 0c504a80cf2e 11.0 cited
-
Restructure index access method API to hide most of it at the C level.
- 65c5fcd353a8 9.6.0 cited
-
Split _bt_insertonpg to two functions.
- bc292937ae6a 8.3.0 cited
-
Major overhaul of btree index code. Eliminate special BTP_CHAIN logic for
- 9e85183bfc31 7.1.1 cited