SA-MP Forums Archive
About SQLite. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: About SQLite. (/showthread.php?tid=254209)



About SQLite. - Zh3r0 - 09.05.2011

So, i heard, that you can use the clause `Key` INTEGER PRIMARY KEY AUTOINCREMENT when creating a table, and that it is more reliable than using SELECT * FROM, but using "SELECT `Key` FROM `Table` WHERE `Bla` = 'Str'" etc.

I heard it is faster to do "SELECT `Key` FROM `Table` WHERE `Bla` = 'Str'" is better than using SELECT * FROM `Table` WHERE `Bla` = 'Str'".

But for example when i use the example with the `Key` sometimes the server crashes.

If code needed, I would like to show.
Sorry for not making it THAT clear, but I want to know the most performance way.


Re: About SQLite. - thiaZ_ - 09.05.2011

1. http://sqlite.com/faq.html#q1


2.

Quote:

I heard it is faster to do "SELECT `Key` FROM `Table` WHERE `Bla` = 'Str'" is better than using SELECT * FROM `Table` WHERE `Bla` = 'Str'"

It should be. With * you are getting every field in that row, it's always better just to get the values you need. Are you sure that there is a column called `Key`, I'm not sure if that's a reason for server crashes, but that could be possible.


Re: About SQLite. - Zh3r0 - 09.05.2011

Quote:
Originally Posted by thiaZ_
Посмотреть сообщение
1. http://sqlite.com/faq.html#q1


2.



It should be. With * you are getting every field in that row, it's always better just to get the values you need. Are you sure that there is a column called `Key`, I'm not sure if that's a reason for server crashes, but that could be possible.
That's the problem, I don't understand anything from their site..I only understand when someone explains to me.
Thanks for the answer, gotta see what i can do.


Re: About SQLite. - thiaZ_ - 09.05.2011

There is a huge difference between the SQLite documentation and this forum. The documentation gives detailed information and good examples, I would prefer the official SQLite site rather than any forum. Users here can't tell you anything more than things that are written there.


Re: About SQLite. - Zh3r0 - 09.05.2011

Quote:
Originally Posted by thiaZ_
Посмотреть сообщение
There is a huge difference between the SQLite documentation and this forum. The documentation gives detailed information and good examples, I would prefer the official SQLite site rather than any forum. Users here can't tell you anything more than things that are written there.
True, but since I'm not having English as my native language, it gets pretty hard to understand what they say.
I learned the basic about SQL from scripts and other's sayings...