Comments (4)
Could you please paste your execution plan (EXPLAIN) ?
Can you reduce the test case to a more simple form that would still exhibit the problem ?
Out of these tables, which ones are foreign and which ones are local ?
What does your implementation return for get_rel_size, and get_path_keys ?
Thank you.
from multicorn.
Thanks for your reply. Here's a Google Doc containing execution plan, get_rel_size, and get_path_keys. All tables are foreign. I can try to create a more concise demo.
from multicorn.
The problem is, your estimates for the returned number of rows are sometimes float which get rounded to the nearest integer.
So, these two both get rounded to 1:
[[u'btype', u'keykey'], 1.0022],
[[u'btype', u'keykey', u'keystoreid'], 1]
In that case, the planner picks the first one since it has no indication regarding what would be the cheapest path.
I guess those estimates do not reflect the reality of your data: if filtering on only two of those attributes would return only one row, you shouldn't care about the third, right ?
I think you should reconsider your implementation of get_path_keys and get_rel_size.
A quick and dirty hack would be to just list them from most specific to least specific, regardless of the cost.
I'm still investigating why the btype=1 qual comes twice, but it is a minor inconvenience and it is not "replacing" anything as you initially supposed.
from multicorn.
Thanks, again!
I believe the 1.0022 value is accurate in the sense that [btype, keykey] is not a truly unique index. The average query using this key will return 1.0022 rows. The number is close to 1 (unique) but using this key is considerable less efficient than the truly unique key [btype, keykey, keystoreid]. That's just the nature of my underlying ISAM files. So the rounding is a problem for me.
You are correct, I see now that the floats are being rounded. Any chance that code can be changed to support floats? Otherwise I guess I could perform some artificial manipulation.
The easiest would be to multiple each by 10,000 and round. Turn 1 into 10000 and 1.0022 into 10022. But that gives a drastically wrong answer to the question, "How many rows would be returned?". I assume that will foul up Postgres.
I guess I could come up with something to sort the list, start with lowest number, round, and then increment by 1 until I get a unique ranking so there's no confusion. That will still distort the numbers but hopefully not too much.
The extra "btype = 1" issue is low priority for me now. They don't cause a problem for my code. I agree now it's not replacing anything. I can continue to help in that are if you're interested though.
from multicorn.
Related Issues (20)
- Makefile: expr doesn't support floats
- the return of 'Plpy is not a built-int module' HOT 4
- ERROR: could not access file "$libdir/multicorn": No such file or directory HOT 2
- how to compile multicorn HOT 1
- During attempted install, warning about missing MacOSX10.14.sdk, error about stdio.h not found HOT 1
- Out of Memory Errors cause core dump
- ImportError No module named multicorn
- Failure to reinitailze null array causes core dump
- rowid_column difficulties HOT 2
- Build error against PostgreSQL 13 HOT 16
- Support for JOINs HOT 1
- why the operator "ID=999999999999999999999999" cannot get the result , when query on the numeric(24,0) column ? HOT 2
- First request speed
- Build error in Postgres 13 HOT 1
- Build error against PostgreSQL 14 HOT 21
- Push JOINs to the fdw level HOT 2
- Is Multicorn dead? HOT 19
- Multicorn is forked & alive in a new place: pgsql-io/multicorn HOT 2
- Multicorn2.org is born HOT 2
- multicorn.so: undefined symbol: oid_hash
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from multicorn.