Dusty Burns wrote:
> SELECT peers.compact, torrents.seeds, torrents.peers FROM torrents,
> peers WHERE
> torrents.info_hash='517a5ae2e1d79ad252f4c126e4ea30d9c6e51c17'
> AND peers.info_hash=torrents.info_hash
> LIMIT 50;
>
> which gives something like this
>
> peers.compact | torrents.seeds | torrents.peers
> -----------------------------------------------
> data | 1234 | 1234
> data | 1234 | 1234
> data | 1234 | 1234
> data | 1234 | 1234
> data | 1234 | 1234
> etc...
>
> however, i'm getting torrents.seeds, torrents.peers with every row
> returned which is redundant (possibly inefficient?)..
> i only want the torrents.seeds, torrents.peers once.. the
> peers.compact can be returned as usual
If this bothers you so much, you can run two separate queries:
SELECT torrents.seeds, torrents.peers FROM torrents
WHERE torrents.info_hash='517a5ae2e1d79ad252f4c126e4ea30d9c6e51c17';
SELECT peers.compact FROM peers
WHERE peers.info_hash='517a5ae2e1d79ad252f4c126e4ea30d9c6e51c17'
LIMIT 50;
I predict you'll find performance difference immeasurably small.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users