I have a table in PostgreSQL where I want to select any new "ticker" values, that weren't in the table the previous "trade\_date".

The following query takes 1 minute to run and the table contains about 56k rows:

```
SELECT DISTINCT a.trade_date, a.ticker, a.company_name
FROM t_ark_holdings a
WHERE a.ticker NOT IN (
                        SELECT b.ticker FROM t_ark_holdings b WHERE b.trade_date <a.trade_date
                        )
ORDER BY a.trade_date DESC, a.ticker, a.company_name

```

My table structure is as follow:
[![enter image description here](https://i.stack.imgur.com/EdEzN.png)](https://i.stack.imgur.com/EdEzN.png)

I was wondering a few things:

1. Is this the efficient way to write the SQL query
2. Should I add indexes on "trade\_date" and "ticker" to the table structure
3. Would it help to switch to pandas as the table will grow in size with time
Thanks

**EDIT:**
Adding the results wanted:
[![enter image description here](https://i.stack.imgur.com/WioI7.png)](https://i.stack.imgur.com/WioI7.png)

So for instance, on the 9/17/21, there were a few tickers (highlited in red) that weren't in the table on the **previous days**