SQL - Filtering large tables with joins - best practices

前端 未结 3 842
不知归路
不知归路 2020-12-30 11:37

I have a table with a lot of data and I need to join it with some other large tables.

Only a small portion of my table is actually relevant for me each time.

3条回答
  •  攒了一身酷
    2020-12-30 12:30

    In a decent cost based query planner what happens is (your case)

    1. join conditions and where conditions are parsed at same level

    2. the type of join and statistics determines the path (what happens first) - in such a way that the smallest intermediate results are retrieved (least I/O > fastest query)

提交回复
热议问题