-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid count returned. #15
Comments
Thanks for pointing out this issue and providing relevant links to the FreeTDS source code. Based on the definition of For the last case, it looks like this can happen here, but I'm not entirely sure what it means in that context. Based on a short analysis, it looks like it means that the query hasn't been executed yet. I don't know how that could be the case in Anyway, a quick fix would probably be to return Did you receive any error messages before you experienced this behavior with Also, I'm curious: what kind of behavior from PostgreSQL did you see when the -1 "broke the costs"? I don't really have any experience with the behavior of PostgreSQL's query planner, so I'm not really sure what would happen in that case. |
Query, analyze, debug log: https://gist.github.com/shulcsm/96509da49c8dd935ced1 |
Interesting, thanks. I don't remember seeing A real "fix" for the root of this problem would probably be to come up with a better way to estimate costs. The current way that Unfortunately, I don't have much time to work on If any interested parties develop enhancements on their own, I'd be happy to merge pull requests. |
No worries, i can work around this. |
I found out today that there's a DB-Library function called dbsetopt. Some options are:
I wonder if these options can somehow be used to get an estimate of executing the query without actually executing the query. I hope to look into this soon and ask about this on the FreeTDS mailing list if I can't figure it out on my own. Also related to the bad
I also wonder if the |
I'm not sure why Commit: fb5b96d I do want to improve how tds_fdw estimates its costs. However, that change will probably be more intrusive. |
By the way, I've added the ability to set the option Commit: e4d830f |
Fixed in version 1.0.2. |
Finally got to trying it out. It works. Thanks! |
Hello, i'm using mssql server and freetds 7.0
This https://github.com/GeoffMontee/tds_fdw/blob/master/src/tds_fdw.c#L905 returns -1 and breaks costs. I found out https://gitorious.org/freetds/freetds/source/d78804636aef4562966e89a8d57aec7bea98cc3b:src/dblib/dblib.c#L2782 exists, but i'm clueless about the topic. Let me know if i can give you any more information.
The text was updated successfully, but these errors were encountered: