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

Refresh auto-completion data in background #4

Closed
eliangcs opened this issue Aug 27, 2015 · 6 comments
Closed

Refresh auto-completion data in background #4

eliangcs opened this issue Aug 27, 2015 · 6 comments

Comments

@eliangcs
Copy link
Member

If we have a lot of tables and views in the database, the program takes some time on startup. I wonder if we can load the auto-completion data in background so that users don't have to wait.

@amjith I'm still not very familiar with the code structure. Do you think if it is doable?

@amjith
Copy link
Member

amjith commented Aug 27, 2015

@eliangcs Yes this is a real concern and using background threads has been in my mind for a while now. dbcli/mycli#109.

Can you tell me how many tables/views are in your database for this to happen? We've tried to minimize the number of queries needed to populate the completions, but I'm wondering if the queries themselves are taking too long or if the data transfer of the huge list from server to the client is taking so long.

Either way a background thread should help.

@dbcli/pgcli-core Do you guys have any thoughts on how else to handle this situation?

@eliangcs
Copy link
Member Author

@amjith In my case I have 500+ tables and 100+ views.

@j-bennet
Copy link
Contributor

Doing this in the background sounds like the way to go. But before that, we should also verify we're only running those queries once on startup, and only pulling as much data as we need.

@eliangcs eliangcs self-assigned this Aug 29, 2015
@eliangcs
Copy link
Member Author

Tried using the code from dbcli/pgcli#345 in vcli, but didn't work. I think it's because vertica_python connection is not thread-safe. We'll need a separate connection for the refresh thread.

@amjith
Copy link
Member

amjith commented Aug 31, 2015

@eliangcs You're right using the same pgexecute object for completion and query is not the way to go. I've updated the PR dbcli/pgcli#345 to handle that case. But I'm still working on resolving the case where multiple completion refresh can be triggered concurrently which can stomp on the completion data-structures.

I'll keep you posted on how I resolve that in pgcli.

@eliangcs eliangcs removed their assignment Sep 14, 2015
@eliangcs
Copy link
Member Author

Implemented in #22.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants