преимущества в определении ХЭШИРОВАНИЯ просто выполнение СОЕДИНЕНИЯ?

    const AppStackNavigator = new StackNavigator({
  WelcomeScreen: { screen: WelcomeScreen }
})


const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#fff',
    alignItems: 'center',
    justifyContent: 'center',
  }**,**
});

это запятая?

13
задан johnnyRose 30 August 2017 в 15:26
поделиться

4 ответа

The optmiser does a good enough job for everyday use. However, in theory it might need 3 weeks to find the perfect plan in the extreme, so there is a chance that the generated plan will not be ideal.

I'd leave it alone unless you have a very complex query or huge amounts of data where it simply can't produce a good plan. Then I'd consider it.

But over time, as data changes/grows or indexes change etc, your JOIN hint will becomes obsolete and prevents an optimal plan. A JOIN hint can only optimise for that single query at the time of development with that set of data you have.

Personally, I've never specified a JOIN hint in any production code.

I've normally solved a bad join by changing my query around, adding/changing an index or breaking it up (eg load a temp table first). Or my query was just wrong, or I had an implicit data type conversion, or it highlighted a flaw in my schema etc.

I've seen other developers use them but only where they had complex views nested upon complex views and they caused later problems when they refactored.

Edit:

I had a conversion today where some colleagues are going to use them to force a bad query plan (with NOLOCK and MAXDOP 1) to "encourage" migration away from legacy complex nested views that one of their downstream system calls directly.

13
ответ дан 1 December 2019 в 23:16
поделиться

Hash joins parallelize and scale better than any other join and are great at maximizing throughput in data warehouses.

2
ответ дан 1 December 2019 в 23:16
поделиться

The logical plan optimizator doesn't assure to you that it finds the optimal solution: an exact algorithm is too slow to use in a production server; instead there are used some greedy algorithms.

Hence, the rationale behind those commands is to let the user specify the optimal join strategy, in the case the optimizator can't sort out what's really the best to adopt.

0
ответ дан 1 December 2019 в 23:16
поделиться

Единственный совет, который я когда-либо видел в коде доставки, был OPTION (FORCE ORDER). Глупая ошибка в оптимизаторе SQL-запросов может привести к созданию плана, который попытается объединить нефильтрованный varchar и уникальный идентификатор. Добавление FORCE ORDER заставило его сначала запустить фильтр.

Я знаю, перегрузка столбцов - это плохо. Иногда с этим приходится жить.

1
ответ дан 1 December 2019 в 23:16
поделиться
Другие вопросы по тегам:

Похожие вопросы: