Skip to content
This repository has been archived by the owner on Jan 28, 2021. It is now read-only.

Indexes on language func does not work with aliased cols #639

Closed
dpordomingo opened this issue Mar 6, 2019 · 1 comment
Closed

Indexes on language func does not work with aliased cols #639

dpordomingo opened this issue Mar 6, 2019 · 1 comment
Assignees
Labels
bug Something isn't working empathy-sessions Issue filed as as part of empathy sessions

Comments

@dpordomingo
Copy link
Contributor

discovered at https://github.com/src-d/empathy-sessions/issues/37#issuecomment-470041061

time srcd sql "SELECT file_path, language(file_path, blob_content)
FROM files
WHERE language(file_path, blob_content)='JSX';"
+------------------------------------+--------------------------------+
|             FILE PATH              |   LANGUAGE(FILES FILE PATH,    |
|                                    |      FILES BLOB CONTENT)       |
+------------------------------------+--------------------------------+
| src/js/components/posts.jsx        | JSX                            |
| src/js/components/repositories.jsx | JSX                            |
+------------------------------------+--------------------------------+
real	0m12.926s

Then I created an index, following your example to create an index on language expresion

$ time srcd sql "CREATE INDEX files_lang_idx ON files USING pilosa (language(file_path, blob_content));
+
+

real	0m0.236s

And queried again, and the time processing was reduded from ~15s to ~.3s what is nice.

But then I queried using an aliased column... and ~15s again.

$ time srcd sql "SELECT file_path, language(file_path, blob_content) as lang 
FROM files
WHERE lang='JSX';"

...

real	0m12.147s
@dpordomingo dpordomingo changed the title Indexes over language function does not work with aliased cols Indexes on language func does not work with aliased cols Mar 6, 2019
@erizocosmico
Copy link
Contributor

I think this is more of a bug than a feature request, WDYT @ajnavarro?

@kuba-- kuba-- self-assigned this Mar 20, 2019
@kuba-- kuba-- transferred this issue from src-d/gitbase Mar 20, 2019
@kuba-- kuba-- added bug Something isn't working empathy-sessions Issue filed as as part of empathy sessions labels Mar 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working empathy-sessions Issue filed as as part of empathy sessions
Projects
None yet
Development

No branches or pull requests

3 participants