From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 8I4PMLk5hGAWjgAAgWs5BA (envelope-from ) for ; Sat, 24 Apr 2021 17:31:05 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 8AWsK7k5hGDOdAAAbx9fmQ (envelope-from ) for ; Sat, 24 Apr 2021 15:31:05 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 399922CB10 for ; Sat, 24 Apr 2021 17:31:05 +0200 (CEST) Received: from localhost ([::1]:33724 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1laKFM-000143-88 for larch@yhetil.org; Sat, 24 Apr 2021 11:31:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45314) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1laKF8-00013B-I5 for guix-devel@gnu.org; Sat, 24 Apr 2021 11:30:51 -0400 Received: from mail-vs1-xe2b.google.com ([2607:f8b0:4864:20::e2b]:39563) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1laKF6-0001kG-FJ for guix-devel@gnu.org; Sat, 24 Apr 2021 11:30:50 -0400 Received: by mail-vs1-xe2b.google.com with SMTP id u22so15105687vsu.6 for ; Sat, 24 Apr 2021 08:30:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JJUdMyaXw6tAgZSaTWH0vG6Ts00rqhKP85Ute0Mk6ds=; b=QFA8l9BaDw4qswGJkE/UuaQlMFgm1mrEgThT4kinA/BKUgLUZ6OPvLLgOIVp7nG24q fVWh2QDCEN0rUi0NeUqKOqRoJ6o3IvAzkDD4QtQSn+v9K24E0h7RsZLb3WQBbQ0Wtu5e geymloKRnPI7KLeN8OHBPq/Z4afFxFvkpEN6TYUAgkth9KK4m/FMd/kRPES8PuPgzOB3 jnIWLwnci/OieMUUzWWq/OjCrJ+Znnt31hiqpKPMaG0es+aqE9UB6Jt93ekEQcgzeeua 3LmBwQ6RRabRWVooy0VZRX8Gnq0948tylJyKDTwo5j8iUx2KajEGsefj8iCSg0QlVtCh lgTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JJUdMyaXw6tAgZSaTWH0vG6Ts00rqhKP85Ute0Mk6ds=; b=Hx2Qmm0J4fzMiKScYFwKiANb0XB84eS4BzxWpp77ymVbJ0UsbwlMbhBwKDvpAQBD1x Z/PlEVmp7kvNkp194xXcbIyDzvfR0R9mZr+CNtXs9+EhckjaRcNV3Z3/01Vzx+cISi59 qlIzm9wh0KLq+szmxRpjaYyHxDE7y2fx0BE/PrH3udTO8PW27lmaQ6kVhsIC5I9uKnFg 0MA/6fjuVpvy8lCaWlOfEKII6cIntXne7/efVwU0Vt9Gasgt+hn4v8IrgIcqNP7g9f01 v36i0JVOOev6ewQWswfFKAOrt8SXOSsNReVfrFf6a882z2JTINWpdgKgJK3pbgyfjTpR Q3xw== X-Gm-Message-State: AOAM532cUxxvp0DUYS4N89VhRPpdEfBqk5Pvlkjnda21Lb/8JdORaUpZ 0l5hvocpdznV0FLbRUyr2pbJetbFAEudn1fbpTNAuXau1ytTCw== X-Google-Smtp-Source: ABdhPJw2Y6m7oI3R7NvUOKHnik7nuipqkShYe83+1aywtsn2XE2HXjn+X8GZaVRo1H5KIVQiwWkx44On82Eq7gM40ug= X-Received: by 2002:a67:e017:: with SMTP id c23mr7404194vsl.23.1619278245743; Sat, 24 Apr 2021 08:30:45 -0700 (PDT) MIME-Version: 1.0 References: <79d3d2e5c1386b1e162f1ba8380562720131856d.camel@telenet.be> <87tuo7xljp.fsf@cbaines.net> <87lf9ixz5j.fsf@cbaines.net> <87wnsziing.fsf@cbaines.net> <87mttuhyoq.fsf@cbaines.net> <878s5ahzke.fsf@cbaines.net> <87sg3hgq1r.fsf@cbaines.net> <87zgxngbd5.fsf@cbaines.net> In-Reply-To: <87zgxngbd5.fsf@cbaines.net> From: Canan Talayhan Date: Sat, 24 Apr 2021 18:30:09 +0300 Message-ID: Subject: Re: [Outreachy] - Guix Data Service - Set a more informative page title To: Christopher Baines Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2607:f8b0:4864:20::e2b; envelope-from=canan.t.talayhan@gmail.com; helo=mail-vs1-xe2b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: guix-devel@gnu.org Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1619278265; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=JJUdMyaXw6tAgZSaTWH0vG6Ts00rqhKP85Ute0Mk6ds=; b=tkG8LrMolyK/aJmAgitfueKrAHDAZFOSiyF54qLscW+0rEhP45ClA0cVpbce9JkF2laDpJ uk5lWCRKK930rRAT8gCLPE5RFcPDwWASq3/ccVm69sQvBQY+u2tojsZ56dRmY/Qgm9apxT +6SpLrPAhubmhY54Zepko6bBXCHQ30zq2PNtgv80450jPyQlOKkDXlMIWmCNkbNAifUxVq dJoFYxjp7AYggMFgdml0lL7+kr2mSsPodDZOG7oNYbFyk5xIC5h8m5FsiNglSaN7tcxuxw DddhwrPZiWMeYmjPGCqcW4O1ZfNTShuUCbf1CFymikf//T1SylgWJTYZMR5ivg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1619278265; a=rsa-sha256; cv=none; b=s8vdCNkyeYEpbB8xubP8GA6ZdzbZxKIjHww2g+XSLkLKhUO1c0FnM60qNAU6mjQd7R53Tb TOZRMu4Hp10Jw2QXBm32M4VARnb4Zp9sPAt6TcOTaSl4KN3p4zAGFJ4oKEn+CfQOzdick8 PBRDhfMmJkjRkGJ275ui77jvNN3dX/KNaEsqxLrczxbfD9x47woFT65+Kvb0zs24gzBmyP wQHpGnR7jylPMr8BPaVlCwzHfL831JJ4fZIMNkO/LsjRVGSVIpP6lcH5DrNwcvBVCpmOWj rCETnPmrCnH5Er5RFIQ/JG0/D7PdWidDvwaZeJeMmWpxAgtNEplYLOqkQoTE+A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=QFA8l9Ba; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Spam-Score: -1.64 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=QFA8l9Ba; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Queue-Id: 399922CB10 X-Spam-Score: -1.64 X-Migadu-Scanner: scn0.migadu.com X-TUID: nApu6RNP1SiE Thanks for your quick response. It helps a lot to me. But still, I have some confusion about the reproduction steps. As I understand it, I can reproduce the slow query just using the pure SQL queries without touching the code for now, right? Please find my steps below: 1. CREATE TEMPORARY TABLE temp_package_metadata (LIKE package_metadata INCLUDING ALL) As we expected, it creates a table but has no data. So I want to insert some data but colon types are integer and I don't know any meaningful data for these colons. 2. CREATE TEMPORARY TABLE temp_package_metadata AS TABLE package_metadata Then I create a copy of the package_metadata. 3. EXPLAIN ANALYZE SELECT * FROM temp_package_metadata This code generates 155 msec execution time, but I think it should take more time. Am I still on the right track? On Sat, Apr 24, 2021 at 2:39 PM Christopher Baines wrote: > > > Christopher Baines writes: > > > The approach I'd recommend is, make yourself a realistic > > temp_package_metadata table by populating it with all the > > package_metadata entries for a single revision already in your local > > database. Then construct and try the slow query, and see how long it > > takes, and look at the query plan (run the query with EXPLAIN at the > > start). > > Following up on your question on IRC about creating the temporary table, > the code that does this is here [1]. I wouldn't suggest running the > code, just the same SQL it uses, and use relevant values for > temp-table-name and table-name that are appropriate for the > package_metadata table. > > 1: https://git.savannah.gnu.org/cgit/guix/data-service.git/tree/guix-data-service/model/utils.scm#n313