Created
May 20, 2011 15:05
-
-
Save aschreyer/983103 to your computer and use it in GitHub Desktop.
Examples of the Eigen PostgreSQL extension
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT '{1,2,3,4,5}'::arrayxi & '{5,4,3,2,1}'::arrayxi; | |
| ?column? | |
| --------------- | |
| '{0,0,3,0,0}' | |
| (1 row) | |
| Time: 0.290 ms |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT arrayxi_euclidean(ar, arrayxi_constant(128,5)) | |
| FROM dev.eigen ORDER BY 1 LIMIT 10; | |
| arrayxi_euclidean | |
| ------------------- | |
| 62.393909959226 | |
| 78.3326241102646 | |
| 163.978657147813 | |
| 215.900440018079 | |
| 234.33736364481 | |
| 314.625173817989 | |
| 314.915861778984 | |
| 322.172314142603 | |
| 324.696781628645 | |
| 363.395101783169 | |
| (10 rows) | |
| Time: 169.806 ms |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT arrayxi_mean(ar) | |
| FROM dev.eigen ORDER BY 1 LIMIT 10; | |
| arrayxi_mean | |
| -------------- | |
| 77 | |
| 187 | |
| 346 | |
| 375 | |
| 409 | |
| 462 | |
| 487 | |
| 565 | |
| 722 | |
| 750 | |
| (10 rows) | |
| Time: 138.167 ms |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT COUNT(*) FROM dev.eigen; | |
| count | |
| -------- | |
| 378675 | |
| (1 row) | |
| Time: 143.626 ms |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| INSERT INTO dev.eigen | |
| SELECT arrayxi_random(128) | |
| FROM credo.aromatic_ring_atoms; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment