KNN search two arrays with 2000 elements
What I did:
- installed postgresql 9.3.1
- installed postgis 2.1.2
- I tried to find the distance by selecting column input_variable_1 with value 50.
I got the following result.
select input_variable_1 <-> 50 as distance from test_ata limit 10;
distance
48
2
17
29
44
37
45
17
49
2
(10 rows)
what i want:
input: column which stores array values say 2000 elements in a single record.
I came across cube extension and postGIS there i can get distance between two points by using tree and distance concepts for lower dimentsions upto 100.
- How to find the distance between two arrays having elements atleast 2000 in postgresql?
- which tree is best for 2000 dimension indexing in postgresql?
- finally i want to know how to use KNN search in postgresql?
postgresql-9.3 postgis nearest-neighbor
bumped to the homepage by Community♦ 1 min ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
What I did:
- installed postgresql 9.3.1
- installed postgis 2.1.2
- I tried to find the distance by selecting column input_variable_1 with value 50.
I got the following result.
select input_variable_1 <-> 50 as distance from test_ata limit 10;
distance
48
2
17
29
44
37
45
17
49
2
(10 rows)
what i want:
input: column which stores array values say 2000 elements in a single record.
I came across cube extension and postGIS there i can get distance between two points by using tree and distance concepts for lower dimentsions upto 100.
- How to find the distance between two arrays having elements atleast 2000 in postgresql?
- which tree is best for 2000 dimension indexing in postgresql?
- finally i want to know how to use KNN search in postgresql?
postgresql-9.3 postgis nearest-neighbor
bumped to the homepage by Community♦ 1 min ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
What I did:
- installed postgresql 9.3.1
- installed postgis 2.1.2
- I tried to find the distance by selecting column input_variable_1 with value 50.
I got the following result.
select input_variable_1 <-> 50 as distance from test_ata limit 10;
distance
48
2
17
29
44
37
45
17
49
2
(10 rows)
what i want:
input: column which stores array values say 2000 elements in a single record.
I came across cube extension and postGIS there i can get distance between two points by using tree and distance concepts for lower dimentsions upto 100.
- How to find the distance between two arrays having elements atleast 2000 in postgresql?
- which tree is best for 2000 dimension indexing in postgresql?
- finally i want to know how to use KNN search in postgresql?
postgresql-9.3 postgis nearest-neighbor
What I did:
- installed postgresql 9.3.1
- installed postgis 2.1.2
- I tried to find the distance by selecting column input_variable_1 with value 50.
I got the following result.
select input_variable_1 <-> 50 as distance from test_ata limit 10;
distance
48
2
17
29
44
37
45
17
49
2
(10 rows)
what i want:
input: column which stores array values say 2000 elements in a single record.
I came across cube extension and postGIS there i can get distance between two points by using tree and distance concepts for lower dimentsions upto 100.
- How to find the distance between two arrays having elements atleast 2000 in postgresql?
- which tree is best for 2000 dimension indexing in postgresql?
- finally i want to know how to use KNN search in postgresql?
postgresql-9.3 postgis nearest-neighbor
postgresql-9.3 postgis nearest-neighbor
edited Mar 24 '17 at 8:49
Marco
3,73231524
3,73231524
asked Mar 23 '17 at 14:15
harishankarharishankar
61
61
bumped to the homepage by Community♦ 1 min ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 1 min ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
You have one option, you can recompile the cube
extension to use more than 100 dimensions
KNN Search is done with PostGIS using the <->
operator on two points. You can find out how to do that in the docs.. It doesn't operate in Nd-space. PostGIS isn't an abstract library for math. It's for real world geospatial problems. KNN in 1d, and 4d+ is not a real world problem, or at least not in the domain that PostGIS would be interested in.
I would suggest checking out my other answer here,
- Searching in n-dimensional space
1.first convert your array into cube(array) 2.apply cube_distance to the converted array 3.apply sorting u may get nearest values
– harishankar
Mar 31 '17 at 11:39
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "182"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f167996%2fknn-search-two-arrays-with-2000-elements%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You have one option, you can recompile the cube
extension to use more than 100 dimensions
KNN Search is done with PostGIS using the <->
operator on two points. You can find out how to do that in the docs.. It doesn't operate in Nd-space. PostGIS isn't an abstract library for math. It's for real world geospatial problems. KNN in 1d, and 4d+ is not a real world problem, or at least not in the domain that PostGIS would be interested in.
I would suggest checking out my other answer here,
- Searching in n-dimensional space
1.first convert your array into cube(array) 2.apply cube_distance to the converted array 3.apply sorting u may get nearest values
– harishankar
Mar 31 '17 at 11:39
add a comment |
You have one option, you can recompile the cube
extension to use more than 100 dimensions
KNN Search is done with PostGIS using the <->
operator on two points. You can find out how to do that in the docs.. It doesn't operate in Nd-space. PostGIS isn't an abstract library for math. It's for real world geospatial problems. KNN in 1d, and 4d+ is not a real world problem, or at least not in the domain that PostGIS would be interested in.
I would suggest checking out my other answer here,
- Searching in n-dimensional space
1.first convert your array into cube(array) 2.apply cube_distance to the converted array 3.apply sorting u may get nearest values
– harishankar
Mar 31 '17 at 11:39
add a comment |
You have one option, you can recompile the cube
extension to use more than 100 dimensions
KNN Search is done with PostGIS using the <->
operator on two points. You can find out how to do that in the docs.. It doesn't operate in Nd-space. PostGIS isn't an abstract library for math. It's for real world geospatial problems. KNN in 1d, and 4d+ is not a real world problem, or at least not in the domain that PostGIS would be interested in.
I would suggest checking out my other answer here,
- Searching in n-dimensional space
You have one option, you can recompile the cube
extension to use more than 100 dimensions
KNN Search is done with PostGIS using the <->
operator on two points. You can find out how to do that in the docs.. It doesn't operate in Nd-space. PostGIS isn't an abstract library for math. It's for real world geospatial problems. KNN in 1d, and 4d+ is not a real world problem, or at least not in the domain that PostGIS would be interested in.
I would suggest checking out my other answer here,
- Searching in n-dimensional space
edited Apr 13 '17 at 12:42
Community♦
1
1
answered Mar 23 '17 at 17:08
Evan CarrollEvan Carroll
32k969219
32k969219
1.first convert your array into cube(array) 2.apply cube_distance to the converted array 3.apply sorting u may get nearest values
– harishankar
Mar 31 '17 at 11:39
add a comment |
1.first convert your array into cube(array) 2.apply cube_distance to the converted array 3.apply sorting u may get nearest values
– harishankar
Mar 31 '17 at 11:39
1.first convert your array into cube(array) 2.apply cube_distance to the converted array 3.apply sorting u may get nearest values
– harishankar
Mar 31 '17 at 11:39
1.first convert your array into cube(array) 2.apply cube_distance to the converted array 3.apply sorting u may get nearest values
– harishankar
Mar 31 '17 at 11:39
add a comment |
Thanks for contributing an answer to Database Administrators Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f167996%2fknn-search-two-arrays-with-2000-elements%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown