From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng2.m.smailru.net (smtpng2.m.smailru.net [94.100.179.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 5EEC84696C3 for ; Fri, 10 Apr 2020 19:56:43 +0300 (MSK) References: <0bbcecda4f9f2a016eef86f780138ce9ed6afee8.1585954494.git.sergepetrenko@tarantool.org> <7FF9C776-045A-4ADF-B44B-0CFB7FD746F9@tarantool.org> From: Vladislav Shpilevoy Message-ID: <18339504-b1d2-2856-a9b0-605f4f2f454f@tarantool.org> Date: Fri, 10 Apr 2020 18:56:41 +0200 MIME-Version: 1.0 In-Reply-To: <7FF9C776-045A-4ADF-B44B-0CFB7FD746F9@tarantool.org> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [Tarantool-patches] [PATCH 4/4] box: introduce indices by UUID List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Serge Petrenko Cc: tml >>> +} >>> + >>> +static inline int >>> +mp_compare_uuid(const char *field_a, const char *field_b) >>> +{ >>> + return mp_compare_uuid_with_type(field_a, mp_typeof(*field_a), >>> + field_b, mp_typeof(*field_b)); >>> +} >>> @@ -1578,6 +1642,21 @@ hint_decimal(decimal_t *dec) >>> return hint_create(MP_CLASS_NUMBER, val); >>> } >>> >>> +static inline hint_t >>> +hint_uuid(struct tt_uuid *uuid) >>> +{ >>> + /* Simply take the first part of the UUID as hint. */ >> >> 5. Why only first? > > I meant, take the ‘high’ part of the UUID. The one which’s compared first. The current hint is good. I forgot hints should be ordered.