Let $\{a_n\}_{1\leq n\geq N}$, $a_n\in \mathbb{C}$. Let $F(s) = \sum_{n=1}^N a_n n^{-s}$. By a mean-value theorem (Montgomery-Vaughan, 1973), $$\int_0^T |F(i t)|^2 = \sum_{n=1}^N |a_n|^2 (T + O(n)).$$
Now, suppose that $\{a_n\}$ has prime support (i.e., $a_n=0$ for all composite $n$). Can we obtain a better bound? (Can we save a factor of roughly $\log n$ on the term $O(n)$, say?)
(The motivation here is an (imperfect) analogy with the large sieve for sequences with prime support.)
An interesting case would be given by $a_p = (\log p)^2/p$ with $a_n=0$ for $n$ composite. Then $\sum_{n=1}^N |a_n|^2 n$ is in the order of $(\log N)^4$. Can we go down to $O((\log N)^3)$?