A
A
alexx_mirny2015-10-06 06:23:26
Database
alexx_mirny, 2015-10-06 06:23:26

How are registers 1s arranged? How effective is their use in database design?

I faced 1s some time ago. And I saw a very curious class of objects - registers. I found them interesting in terms of performance. And I wanted to implement them in my project.
What can be read on this topic? Do they have a common name?

Answer the question

In order to leave comments, you need to log in

6 answer(s)
S
Shalimo, 2015-10-06
@alexx_mirny

MG Radchenko - Professional development in the 1C system.

A
argumentum, 2015-10-07
@argumentum

In terms of performance, what did you like about them?
If in terms of productivity of writing code by a developer, then yes, database operations when using registers are encoded faster than in classic SQL.
If it’s not about the performance of data entry/selection, then they will work slower than regular SQL queries to a SQL server without 1C mediation. Especially if stored procedures are used. It is difficult to say how much slower, it depends very much on the task. Often the difference is so small that it can be ignored.

A
Alexey Nechaev, 2012-03-14
@Dmarck

To update, I use the following code, only the ssh_connect function is required
update.php .update.sh Well, then we just call update.php
if(!($con = ssh2_connect("127.0.0.1", 22))){
$data = "fail: unable to establish connection\n";
} else {
$cc = ssh2_auth_password($con, "svn-user", "svn-user-password");
if(!$cc) {
$data = "fail: unable to authenticate\n";
} else {
if (!($stream = ssh2_exec($con, "/var/www/.update.sh"))) {
$data = "fail: unable to execute command\n";
} else {
$errorStream = ssh2_fetch_stream($stream, SSH2_STREAM_STDERR);
stream_set_blocking($stream, true);
$data = stream_get_contents($stream);
$data2 = stream_get_contents($errorStream);
fclose($stream);
}
}
}
echo @$data;


#!/bin/sh
cd /var/www/site
svn update --username="svn-u" --password="svn-p" --non-interactive

I
Igor Fatkulin, 2012-03-14
@ingiboy

Our solution on the project server is fast and cool - a post-commit hook is configured in the repository, which creates an empty flag file with the project name (the project name and the folder where the site itself is located are the same). The cron runs a script that reads the flag files from the folder, cd /data/folder-with-sites/<project-name> and runs svn update. Perhaps this system, with a large number of developers, will require some kind of blocking, so that if the previous update process is delayed, then the new process will not start.
post commit

#!/bin/sh
REPOS="$1"
REV="$2"
echo $1 $2 $3 $4 $5 > `echo $1 | sed 's/repos/repos\/.need-to-update/'`

(svn repository directory /data/svn/repos/<project-name>)
cron-script.sh
#!/bin/sh
dir=/data/svn/repos/.need-to-update/

for rep in `find $dir -type f`
do
    web=`echo $rep | sed 's/svn\/repos\/.need-to-update/web/'`
    subj=`echo $web | sed 's/\/data\/web\///'`
    echo `date '+%Y-%m-%d %H:%M'` - $subj >>/root/scripts/post-commit-cron.log
    cd $web
    /usr/local/bin/svn --username <svn-user> --password <svn-user-passwd> --no-auth-cache update >>/root/scrip
    /usr/local/bin/svn info >>rev.log
    echo >>rev.log
    /bin/chmod -R a+rwX ./
    /usr/sbin/chown -R www:www ./
    rm $rep
# echo ' ' | mail -s "U $subj" root
    echo >>/root/scripts/post-commit-cron.log
done

(website directory /data/web/<project-name>)

L
Longer, 2012-03-15
@Longer

Another option is to write a simple daemon that uses local sockets and runs under the rights of the one from whom you need to do svn update.
I did something like this to solve a similar problem. But there it was necessary to simultaneously do svn up on 2 servers. On the second one, I raised my daemon listening to some port, and if it connects to it, then svn up is done and immediately breaks. Here, as an option, you can apply a similar solution, but since. it is necessary to do it inside one server, to use local sockets.

A
anycolor, 2012-03-15
@anycolor

It is possible to do with each commit through the post-commit svn up. Or is this option not suitable / not to your liking?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question