| От | Joe Conway |
|---|---|
| Тема | Re: why does this select hang postgres??? |
| Дата | |
| Msg-id | 00b101c121cb$b5aac570$b4d210ac@jecw2k1 обсуждение исходный текст |
| Ответ на | why does this select hang postgres??? (Jeremy Hansen <jeremy@xxedgexx.com>) |
| Список | pgsql-general |
> > select * from env_info,summary,plat_info; > > Is my statement broken? Is this not legal? Postgres just sits there.... > > My goal is to select everything from multiple tables with one sql > statement. > > Thank You! > -jeremy > Well, you'll get everything and then some ;) This statement is called a cartesian join. What that means you will get the <# of rows in env_info> *times* <# of rows in summary> *times* <# of rows in plat_info>. So if env_info has 1000 rows,summary has 5000 rows, and plat_info has 200 rows, the query will try to return 1000 * 5000 * 200 = 1,000,000,000 rows! So while it may *seem* to just sit there, Postgres is actually probably just working *really* hard. HTH, Joe
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера