Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. COLike I said, I don't administer the database and I can't add indexes. I have only the read permissions. Also, the order of the join DOES make a difference. The query doesn't result in error, but the problem then is that if a device has made no records in large_table, then there is nothing to left join onto the data in small_table which does, in fact, contain a record of such a device. The admin told me to do that in two separate queries, but doing it that way just complicates applications which use the database unnecessarily IMHO. Also, I've updated my question to add the query.
      singulars
    2. COIt works without the LEFT not because there is some issue with left joins, but because you are sorting on a column in the right table. But what happens if the right table is blank (missing)? How should it sort? What happens is that it's not able to just look in the large table and directly find the most recent date - that might not be the correct row, since it's possible the correct row will have no record in the large table, and only in the small table. So it must actually calculate everything, and then sort.
      singulars
    3. COSo tell me, what do you expect for blank rows in the large table? How should it sort? Why do you need the left join? You'll never actually get record from the small table, that are missing a record on the large table, because you are sorting by a value on the large table and getting only one of them. Missing rows will never show up.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload