![]() ![]() It's my understanding that PostgreSQL's foreign data wrappers (a similar feature to SQLite's virtual tables) push much more information about the query down to the wrapper layer, but I haven't used it myself. There's nothing I can do about it (other than heuristically guessing what IDs might be coming and request them ahead of time) because SQLite doesn't provide enough information to the virtual table layer. I wrote a module that exposes remote SQL Server/PostgreSQL/MySQL servers as SQLite virtual tables, and joins basically don't work at all if your server is not on your local network. If you're writing a virtual table that accesses a remote resource with some latency, any join will absolutely ruin your performance as you pay a full network roundtrip for each of those N queries. ![]() Instead, you will receive a series of N queries for individual IDs, even if you could have more efficiently retrieved them in a batch. You're forced to retrieve and return every row because you have no idea that it was actually just a count.Īs another example, if the user query includes a join, you won't see the join. That's great, unless you already know the count and could have reported it directly rather than actually returning every row in the table. the query your virtual table will effectively see is: ![]() Many parts of the query are not pushed down into the virtual table. You don't need to know much and indeed, you can't know much about the execution engine, even if that knowledge would help you. I like the virtual table API a lot but it has some serious drawbacks. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |