```dataview
LIST WITHOUT ID Q.text
FROM "file.path"
FLATTEN Question as Q
```
If you use the WHERE file = this.file it’s somewhat more expensive as that has to look through the entire file list of your vault to single out that one file.
I’ve been looking for a much more efficient way than WHERE file.name = this.file.name (ie. in the FROM clause), but for my purposes it has to be programmatic - I embed a lot of reusable queries across lots of files. I assume you mean a literal string of the file path/name in this example?
Given a file named “test.md” located somewhere in your vault, you should be able to use FROM "test.md" or WHERE file.name = "test.md" (or from within that file itself WHERE file = this.file )
The difference between these are from a logical point of view the following:
The FROM needs to scan the file list, and select the properly named file. This should be a lookup in some table, and not very expensive
The WHERE variants on the other hand will start of with all files, and prepare each and every file for a WHERE clause, which in this case only limits on the file/filename itself. Theoretically this would mean it’s possible way more expansive, especially given a large vault
The only uncertainty in the discussion above is how much preparation is needed before it can move on to the WHERE clause. But in any case it should be less work than looking at the file set, and ditching all files not matching the name (or folder if that has been used).
I’ve not come around to timing this, and seeing what effect it has to have a small or larger vault. With large I’m thinking in the tens of thousands of files. I imagine that this effect is neglible for any vault with less than a thousand files, but not sure.