Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] package/systemd: needs glibc
Date: Tue, 4 Dec 2018 09:28:48 +0100	[thread overview]
Message-ID: <20181204092848.26551792@windsurf> (raw)
In-Reply-To: <d1142785-90ff-2a41-b95a-263e10eb120d@mind.be>

Hello,

On Tue, 27 Nov 2018 22:20:37 +0100, Arnout Vandecappelle wrote:

>  It's hard to predict the efficiency of SQL statements, but I would expect
> something like this to be more efficient:
> 
> select * from results
>   inner join (select result_id from symbol_per_result A, symbol_per_result B
>               where A.result_id = B.result_id
>                 and A.symbol_id = (select id from config_symbol
>                                    where name = "BR2_INIT_SYSTEMD")
>                 and A.value = "y"
>                 and B.symbol_id = (select id from config_symbol
>                                    where name = "BR2_TOOLCHAIN_USES_UCLIBC")
>                 and B.value = "y")
>     as foo
>   on foo.result_id = results.id
> where builddate > '2018-09-01';

This query doesn't work as-is. First:

ERROR 1052 (23000): Column 'result_id' in field list is ambiguous

Because the "select result_id" in the inner query is ambiguous, using
A.result_id gets passed that.

Then, the "value" field does not exist in the symbol_per_result table.
It's the config_symbol table that associates a symbol name and its
value, so I changed the inner query to:

select A.result_id from symbol_per_result A, symbol_per_result B
	where A.result_id = B.result_id and
	A.symbol_id = (select id from config_symbol where name = "BR2_INIT_SYSTEMD" and value = "y") and
	B.symbol_id = (select id from config_symbol where name = "BR2_TOOLCHAIN_USES_UCLIBC" and value = "y");

but that query itself already takes a significant amount of time to
complete:

mysql> select A.result_id from symbol_per_result A, symbol_per_result B where A.result_id = B.result_id and A.symbol_id = (select id from config_symbol where name = "BR2_INIT_SYSTEMD" and value = "y") and B.symbol_id = (select id from config_symbol where name = "BR2_TOOLCHAIN_USES_UCLIBC" and value = "y");
Empty set (3 min 52.15 sec)

I think the issue is that this query is operating on the full set of
results, and that the filtering on the build date to reduce the number
of build results to consider happens afterwards in the outermost query.
I'm really no SQL guru, but since we're interested only in querying the
results for the last few weeks or months, I would assume it should be
faster to first filter the results we're interested in by build date,
and then only do this massive symbol/value research.

If you (or anyone else) wants to play around with this, I've put online
the dump of the database as of today at
http://autobuild.buildroot.net/brautobuild.sql.gz.

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

  reply	other threads:[~2018-12-04  8:28 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-21 21:05 [Buildroot] [PATCH] package/systemd: needs glibc Yann E. MORIN
2018-11-22  2:53 ` Matthew Weber
2018-11-22 16:19 ` Peter Korsgaard
2018-11-22 16:44   ` Thomas Petazzoni
2018-11-22 17:12     ` Yann E. MORIN
2018-11-23  2:30       ` Matthew Weber
2018-11-23  7:45         ` Thomas Petazzoni
2018-11-23  8:27     ` Thomas Petazzoni
2018-11-27 21:20       ` Arnout Vandecappelle
2018-12-04  8:28         ` Thomas Petazzoni [this message]
2018-12-04 10:32           ` Nicolas Cavallari
2018-12-04 11:02             ` Arnout Vandecappelle
2018-12-04 11:17               ` Nicolas Cavallari
2018-11-26 16:54 ` Peter Korsgaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181204092848.26551792@windsurf \
    --to=thomas.petazzoni@bootlin.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox