I'm having two tables called 1. Table A - with multiple columns, having primary key as user_id (900,000+ records) 2. Table B - with single column called user_id (900+ records)
The table A contains all user_id 's of table B and more. I need to get a list of * columns of matching A,B rows by user_id. I'm using the below query, it has already run for 1 hour in my p4 machine with 100% CPU with no result in sight.
SELECT a.* FROM tableA AS a INNER JOIN tableB AS b ON a.user_id = b.user_id;
Is there a way to make the query execution fast?